From c0a274f79c81656efa5fadd03d73b50871dabce3 Mon Sep 17 00:00:00 2001 From: Fred Li <51424245+fredms@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:23:47 -0800 Subject: [PATCH] Fix account feature set not available. (#2976) * Fix account feature set not available * Update the command * Make overwrite equal to true --- .../automation-test/setup-resources-cli.sh | 7 ++++--- .../accounts/spec/FeatureSetSpec.yaml | 17 +++++++++++++++++ ...riment and train models using features.ipynb | 2 +- ...riment and train models using features.ipynb | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 sdk/python/featurestore_sample/featurestore/featuresets/accounts/spec/FeatureSetSpec.yaml diff --git a/sdk/python/featurestore_sample/automation-test/setup-resources-cli.sh b/sdk/python/featurestore_sample/automation-test/setup-resources-cli.sh index 597586cbe44..7bdba9e6097 100644 --- a/sdk/python/featurestore_sample/automation-test/setup-resources-cli.sh +++ b/sdk/python/featurestore_sample/automation-test/setup-resources-cli.sh @@ -14,7 +14,8 @@ REDIS_NAME=${RESOURCE_GROUP}rds FEATURE_VERSION=$(((RANDOM%10)+1)) FEATURESTORE_NAME="my-featurestore" ACCOUNT_ENTITY_PATH="./featurestore/entities/account.yaml" -ACCOUNT_FEATURESET_PATH="./featurestore/featuresets/transactions/featureset_asset.yaml" +TRANSACTIONS_FEATURESET_PATH="./featurestore/featuresets/transactions/featureset_asset.yaml" +ACCOUNT_FEATURESET_PATH="./featurestore/featuresets/accounts/featureset_asset.yaml" TRANSACTION_ASSET_MAT_YML="./featurestore/featuresets/transactions/featureset_asset_offline_enabled.yaml" STORAGE_ACCOUNT_NAME="fstorestorage" STORAGE_FILE_SYSTEM_NAME="offlinestore" @@ -26,7 +27,7 @@ GEN2_CONTAINER_ARM_ID="/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOUR az ml feature-store create --subscription $SUBSCRIPTION_ID --resource-group $RESOURCE_GROUP --location $LOCATION --name $FEATURESTORE_NAME az ml feature-store-entity create --file $ACCOUNT_ENTITY_PATH --resource-group $RESOURCE_GROUP --workspace-name $FEATURESTORE_NAME -az ml feature-set create --file $ACCOUNT_FEATURESET_PATH --resource-group $RESOURCE_GROUP --workspace-name $FEATURESTORE_NAME +az ml feature-set create --file $TRANSACTIONS_FEATURESET_PATH --resource-group $RESOURCE_GROUP --workspace-name $FEATURESTORE_NAME az storage account create --name $STORAGE_ACCOUNT_NAME --enable-hierarchical-namespace true --resource-group $RESOURCE_GROUP --location $LOCATION --subscription $SUBSCRIPTION_ID az storage fs create --name $STORAGE_FILE_SYSTEM_NAME --account-name $STORAGE_ACCOUNT_NAME --subscription $SUBSCRIPTION_ID @@ -36,7 +37,7 @@ UAI_OID=$(az identity show --resource-group $RESOURCE_GROUP -n $UAI_NAME --query az role assignment create --role "AzureML Data Scientist" --assignee-object-id $UAI_OID --assignee-principal-type ServicePrincipal --scope $FEATURE_STORE_ARM_ID az role assignment create --role "Storage Blob Data Contributor" --assignee-object-id $UAI_OID --assignee-principal-type ServicePrincipal --scope $GEN2_CONTAINER_ARM_ID - +az ml feature-set create --file $ACCOUNT_FEATURESET_PATH --resource-group $RESOURCE_GROUP --feature-store-name $FEATURESTORE_NAME # az ml feature-set update --file $TRANSACTION_ASSET_MAT_YML --resource-group $RESOURCE_GROUP --workspace-name $FEATURESTORE_NAME COMPUTE_CLUSTER_NAME="cpu-cluster-fs" diff --git a/sdk/python/featurestore_sample/featurestore/featuresets/accounts/spec/FeatureSetSpec.yaml b/sdk/python/featurestore_sample/featurestore/featuresets/accounts/spec/FeatureSetSpec.yaml new file mode 100644 index 00000000000..c345b457948 --- /dev/null +++ b/sdk/python/featurestore_sample/featurestore/featuresets/accounts/spec/FeatureSetSpec.yaml @@ -0,0 +1,17 @@ +features: +- name: accountCountry + type: string +- name: isUserRegistered + type: boolean +- name: numPaymentRejects1dPerUser + type: double +- name: accountAge + type: double +index_columns: +- name: accountID + type: string +source: + path: wasbs://data@azuremlexampledata.blob.core.windows.net/feature-store-prp/datasources/accounts-precalculated/*.parquet + timestamp_column: + name: timestamp + type: parquet diff --git a/sdk/python/featurestore_sample/notebooks/sdk_and_cli/2. Experiment and train models using features.ipynb b/sdk/python/featurestore_sample/notebooks/sdk_and_cli/2. Experiment and train models using features.ipynb index cd2d4b89519..997e412b6f6 100644 --- a/sdk/python/featurestore_sample/notebooks/sdk_and_cli/2. Experiment and train models using features.ipynb +++ b/sdk/python/featurestore_sample/notebooks/sdk_and_cli/2. Experiment and train models using features.ipynb @@ -604,7 +604,7 @@ "if not os.path.exists(accounts_featureset_spec_folder):\n", " os.makedirs(accounts_featureset_spec_folder)\n", "\n", - "accounts_featureset_spec.dump(accounts_featureset_spec_folder)" + "accounts_featureset_spec.dump(accounts_featureset_spec_folder, overwrite=True)" ] }, { diff --git a/sdk/python/featurestore_sample/notebooks/sdk_only/2. Experiment and train models using features.ipynb b/sdk/python/featurestore_sample/notebooks/sdk_only/2. Experiment and train models using features.ipynb index 0c093c259cd..cbeff4055bc 100644 --- a/sdk/python/featurestore_sample/notebooks/sdk_only/2. Experiment and train models using features.ipynb +++ b/sdk/python/featurestore_sample/notebooks/sdk_only/2. Experiment and train models using features.ipynb @@ -555,7 +555,7 @@ "if not os.path.exists(accounts_featureset_spec_folder):\n", " os.makedirs(accounts_featureset_spec_folder)\n", "\n", - "accounts_featureset_spec.dump(accounts_featureset_spec_folder, overwrite=False)" + "accounts_featureset_spec.dump(accounts_featureset_spec_folder, overwrite=True)" ] }, {