Skip to main content
Version: 0.19.3

JSON folder example

Example directory structure

  • bucket_root
    • nested_folder/
      • 2021-05-03/ -> Date Partition
        • training_data/ -> Sub Folder
          • data.json
      • 2021-05-04/ -> Date Partition
        • training_sample/ -> Sub Folder
          • data.json
from featurestore import Client, JSONFolder

# Initialise feature store client
client = Client("ip:port")
client.auth.login()

# Set project specifics
project = client.projects.create("demo")

# Create the JSON folder source
json_folder = JSONFolder(
root_folder="s3a://feature-store-test-data/nested_folder",
filter_pattern=".*/training.*"
)
json_folder_schema = client.extract_schema_from_source(json_folder)

# Register the feature set
my_feature_set = project.feature_sets.register(json_folder_schema, "feature_set_name", primary_key=["key_name"])

# Ingest to cache
my_feature_set.ingest(json_folder)

# Retrieve feature set
ref = my_feature_set.retrieve()
ref.download()

Feedback