-
Notifications
You must be signed in to change notification settings - Fork 243
Windoze/211 maven submission #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| !noop-1.0.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import os | ||
| from datetime import datetime, timedelta | ||
| from pathlib import Path | ||
|
|
||
| from click.testing import CliRunner | ||
| from feathr import BOOLEAN, FLOAT, INT32, ValueType | ||
| from feathr import FeathrClient | ||
| from feathr import ValueType | ||
| from feathr.utils.job_utils import get_result_df | ||
| from feathr import (BackfillTime, MaterializationSettings) | ||
| from feathr import FeatureQuery | ||
| from feathr import ObservationSettings | ||
| from feathr import RedisSink, HdfsSink | ||
| from feathr import TypedKey | ||
| from feathrcli.cli import init | ||
| import pytest | ||
|
|
||
| from test_fixture import (basic_test_setup, get_online_test_table_name) | ||
|
|
||
| def test_feathr_online_store_agg_features(): | ||
| """ | ||
| Test FeathrClient() get_online_features and batch_get can get data correctly. | ||
| """ | ||
|
|
||
| online_test_table = get_online_test_table_name("nycTaxiCITable") | ||
| test_workspace_dir = Path( | ||
| __file__).parent.resolve() / "test_user_workspace" | ||
| # os.chdir(test_workspace_dir) | ||
|
|
||
| # The `feathr_runtime_location` was commented out in this config file, so feathr should use | ||
| # Maven package as the dependency and `noop.jar` as the main file | ||
| client = basic_test_setup(os.path.join(test_workspace_dir, "feathr_config_maven.yaml")) | ||
|
|
||
| backfill_time = BackfillTime(start=datetime( | ||
| 2020, 5, 20), end=datetime(2020, 5, 20), step=timedelta(days=1)) | ||
| redisSink = RedisSink(table_name=online_test_table) | ||
| settings = MaterializationSettings("nycTaxiTable", | ||
| sinks=[redisSink], | ||
| feature_names=[ | ||
| "f_location_avg_fare", "f_location_max_fare"], | ||
| backfill_time=backfill_time) | ||
| client.materialize_features(settings) | ||
| # just assume the job is successful without validating the actual result in Redis. Might need to consolidate | ||
| # this part with the test_feathr_online_store test case | ||
| client.wait_job_to_finish(timeout_sec=900) | ||
|
|
||
| res = client.get_online_features(online_test_table, '265', [ | ||
| 'f_location_avg_fare', 'f_location_max_fare']) | ||
| # just assme there are values. We don't hard code the values for now for testing | ||
| # the correctness of the feature generation should be garunteed by feathr runtime. | ||
| # ID 239 and 265 are available in the `DOLocationID` column in this file: | ||
| # https://s3.amazonaws.com/nyc-tlc/trip+data/green_tripdata_2020-04.csv | ||
| # View more detials on this dataset: https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page | ||
| assert len(res) == 2 | ||
| assert res[0] != None | ||
| assert res[1] != None | ||
| res = client.multi_get_online_features(online_test_table, | ||
| ['239', '265'], | ||
| ['f_location_avg_fare', 'f_location_max_fare']) | ||
| assert res['239'][0] != None | ||
| assert res['239'][1] != None | ||
| assert res['265'][0] != None | ||
| assert res['265'][1] != None |
118 changes: 118 additions & 0 deletions
118
feathr_project/test/test_user_workspace/feathr_config_maven.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # DO NOT MOVE OR DELETE THIS FILE | ||
|
|
||
| # This file contains the configurations that are used by Feathr | ||
| # All the configurations can be overwritten by environment variables with concatenation of `__` for different layers of this config file. | ||
| # For example, `feathr_runtime_location` for databricks can be overwritten by setting this environment variable: | ||
| # SPARK_CONFIG__DATABRICKS__FEATHR_RUNTIME_LOCATION | ||
| # Another example would be overwriting Redis host with this config: `ONLINE_STORE__REDIS__HOST` | ||
| # For example if you want to override this setting in a shell environment: | ||
| # export ONLINE_STORE__REDIS__HOST=feathrazure.redis.cache.windows.net | ||
|
|
||
| # version of API settings | ||
| api_version: 1 | ||
| project_config: | ||
| project_name: 'project_feathr_integration_test' | ||
| # Information that are required to be set via environment variables. | ||
| required_environment_variables: | ||
| # the environemnt variables are required to run Feathr | ||
| # Redis password for your online store | ||
| - 'REDIS_PASSWORD' | ||
| # client IDs and client Secret for the service principal. Read the getting started docs on how to get those information. | ||
| - 'AZURE_CLIENT_ID' | ||
| - 'AZURE_TENANT_ID' | ||
| - 'AZURE_CLIENT_SECRET' | ||
| optional_environment_variables: | ||
| # the environemnt variables are optional, however you will need them if you want to use some of the services: | ||
| - ADLS_ACCOUNT | ||
| - ADLS_KEY | ||
| - WASB_ACCOUNT | ||
| - WASB_KEY | ||
| - S3_ACCESS_KEY | ||
| - S3_SECRET_KEY | ||
| - JDBC_TABLE | ||
| - JDBC_USER | ||
| - JDBC_PASSWORD | ||
| - KAFKA_SASL_JAAS_CONFIG | ||
|
|
||
| offline_store: | ||
| # paths starts with abfss:// or abfs:// | ||
| # ADLS_ACCOUNT and ADLS_KEY should be set in environment variable if this is set to true | ||
| adls: | ||
| adls_enabled: true | ||
|
|
||
| # paths starts with wasb:// or wasbs:// | ||
| # WASB_ACCOUNT and WASB_KEY should be set in environment variable | ||
| wasb: | ||
| wasb_enabled: true | ||
|
|
||
| # paths starts with s3a:// | ||
| # S3_ACCESS_KEY and S3_SECRET_KEY should be set in environment variable | ||
| s3: | ||
| s3_enabled: true | ||
| # S3 endpoint. If you use S3 endpoint, then you need to provide access key and secret key in the environment variable as well. | ||
| s3_endpoint: 's3.amazonaws.com' | ||
|
|
||
| # jdbc endpoint | ||
| jdbc: | ||
| jdbc_enabled: true | ||
| jdbc_database: 'feathrtestdb' | ||
| jdbc_table: 'feathrtesttable' | ||
|
|
||
| # snowflake endpoint | ||
| snowflake: | ||
| url: "dqllago-ol19457.snowflakecomputing.com" | ||
| user: "feathrintegration" | ||
| role: "ACCOUNTADMIN" | ||
|
|
||
| spark_config: | ||
| # choice for spark runtime. Currently support: azure_synapse, databricks | ||
| # The `databricks` configs will be ignored if `azure_synapse` is set and vice versa. | ||
| spark_cluster: 'azure_synapse' | ||
| # configure number of parts for the spark output for feature generation job | ||
| spark_result_output_parts: '1' | ||
|
|
||
| azure_synapse: | ||
| dev_url: 'https://feathrazuretest3synapse.dev.azuresynapse.net' | ||
| pool_name: 'spark3' | ||
| # workspace dir for storing all the required configuration files and the jar resources | ||
| workspace_dir: 'abfss://[email protected]/feathr_test_workspace' | ||
| executor_size: 'Small' | ||
| executor_num: 4 | ||
|
|
||
| # Feathr Job configuration. Support local paths, path start with http(s)://, and paths start with abfs(s):// | ||
| # this is the default location so end users don't have to compile the runtime again. | ||
| # feathr_runtime_location: wasbs://[email protected]/feathr-assembly-0.5.0-SNAPSHOT.jar | ||
| # Unset this value will use default package on Maven | ||
| # feathr_runtime_location: "../../target/scala-2.12/feathr-assembly-0.5.0.jar" | ||
| databricks: | ||
| # workspace instance | ||
| workspace_instance_url: 'https://adb-5638037984879289.9.azuredatabricks.net/' | ||
| workspace_token_value: '' | ||
| # config string including run time information, spark version, machine size, etc. | ||
| # the config follows the format in the databricks documentation: https://docs.microsoft.com/en-us/azure/databricks/dev-tools/api/2.0/jobs | ||
| config_template: {'run_name':'','new_cluster':{'spark_version':'9.1.x-scala2.12','node_type_id':'Standard_F4s','num_workers':2,'spark_conf':{}},'libraries':[{'jar':''}],'spark_jar_task':{'main_class_name':'','parameters':['']}} | ||
| # Feathr Job location. Support local paths, path start with http(s)://, and paths start with dbfs:/ | ||
| work_dir: 'dbfs:/feathr_getting_started' | ||
|
|
||
| # this is the default location so end users don't have to compile the runtime again. | ||
| # Unset this value will use default package on Maven | ||
| # feathr_runtime_location: "../../target/scala-2.12/feathr-assembly-0.5.0.jar" | ||
|
|
||
| online_store: | ||
| redis: | ||
| # Redis configs to access Redis cluster | ||
| host: 'feathrazuretest3redis.redis.cache.windows.net' | ||
| port: 6380 | ||
| ssl_enabled: True | ||
|
|
||
| feature_registry: | ||
| purview: | ||
| # Registry configs | ||
| # register type system in purview during feathr client initialization. This is only required to be executed once. | ||
| type_system_initialization: true | ||
| # configure the name of the purview endpoint | ||
| purview_name: 'feathrazuretest3-purview1' | ||
| # delimiter indicates that how the project/workspace name, feature names etc. are delimited. By default it will be '__' | ||
| # this is for global reference (mainly for feature sharing). For exmaple, when we setup a project called foo, and we have an anchor called 'taxi_driver' and the feature name is called 'f_daily_trips' | ||
| # the feature will have a globally unique name called 'foo__taxi_driver__f_daily_trips' | ||
| delimiter: '__' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.