Skip to content

Commit

Permalink
style: run black
Browse files Browse the repository at this point in the history
  • Loading branch information
atangwbd committed Apr 4, 2024
1 parent 9e98ae3 commit be93db8
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 24 deletions.
1 change: 1 addition & 0 deletions feathr_project/feathr/datasets/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Dataset utilities
"""

import logging
import math
from pathlib import Path
Expand Down
28 changes: 14 additions & 14 deletions feathr_project/feathr/protobuf/featureValue_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions feathr_project/feathr/registry/_feature_registry_purview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,11 @@ def _list_registered_entities_with_details(
{
"and": [
{
"or": [{"entityType": TYPEDEF_FEATHR_PROJECT}]
if TYPEDEF_FEATHR_PROJECT in entity_type_list
else None
"or": (
[{"entityType": TYPEDEF_FEATHR_PROJECT}]
if TYPEDEF_FEATHR_PROJECT in entity_type_list
else None
)
},
{"attributeName": "qualifiedName", "operator": "startswith", "attributeValue": project_name},
]
Expand Down
6 changes: 3 additions & 3 deletions feathr_project/feathr/udf/_preprocessing_pyudf_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def build_anchor_preprocessing_metadata(anchor_list: List[FeatureAnchor], local_
feature_names.sort()
string_feature_list = ",".join(feature_names)
if isinstance(anchor.source.preprocessing, str):
feature_names_to_func_mapping[
string_feature_list
] = _PreprocessingPyudfManager._parse_function_str_for_name(anchor.source.preprocessing)
feature_names_to_func_mapping[string_feature_list] = (
_PreprocessingPyudfManager._parse_function_str_for_name(anchor.source.preprocessing)
)
else:
# it's a callable function
feature_names_to_func_mapping[string_feature_list] = anchor.source.preprocessing.__name__
Expand Down
1 change: 1 addition & 0 deletions feathr_project/test/test_feature_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_feathr_register_features_e2e(self):

# <ExceptionInfo RuntimeError('Failed to call registry API, status is 409, error is {"message":"Entity feathr_ci_registry_53_3_476999__request_features__f_is_long_trip_distance already exists"}')
assert "status is 409" in str(exc_info.value)

@pytest.mark.skip(reason="Skipping 502 tests due to server side failure")
def test_feathr_register_features_partially(self):
"""
Expand Down
6 changes: 3 additions & 3 deletions feathr_project/test/test_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ def registry_test_setup(config_path: str):
# Use a new project name every time to make sure all features are registered correctly
# Project name example: feathr_ci_registry_2022_09_24_01_02_30
now = datetime.now()
os.environ[
"project_config__project_name"
] = f'feathr_ci_registry_{str(now)[:19].replace(" ", "_").replace(":", "_").replace("-", "_")}'
os.environ["project_config__project_name"] = (
f'feathr_ci_registry_{str(now)[:19].replace(" ", "_").replace(":", "_").replace("-", "_")}'
)

client = FeathrClient(config_path=config_path, project_registry_tag={"for_test_purpose": "true"})
request_anchor, agg_anchor, derived_feature_list = generate_entities()
Expand Down
3 changes: 3 additions & 0 deletions feathr_project/test/test_registry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def test_parse_project():
)
assert len(derived_features) == 3


@pytest.mark.skip(reason="Skip since we cannot connect to external database")
def test_registry_client_list_features():
c = _FeatureRegistry(project_name="p", endpoint="https://feathr-sql-registry.azurewebsites.net/api/v1")
Expand All @@ -229,6 +230,7 @@ def test_registry_client_list_features():
for i in f:
assert i.startswith("feathr_ci_registry_getting_started__")


@pytest.mark.skip(reason="Skip since we cannot connect to external database")
def test_registry_client_load():
c = _FeatureRegistry(project_name="p", endpoint="https://feathr-sql-registry.azurewebsites.net/api/v1")
Expand All @@ -247,6 +249,7 @@ def test_registry_client_load():
)
assert len(derived_features) == 2


@pytest.mark.skip(reason="Skip since we cannot connect to external database")
def test_create():
project_name = f"feathr_registry_client_test_{int(time.time())}"
Expand Down
4 changes: 3 additions & 1 deletion feathr_project/test/unit/utils/test_job_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ def test__get_result_df(
# ("delta", "output-delta", 5),
# ],
# )
@pytest.mark.skip(reason="Skip since this is not in a spark session. This test should alreayd be covered by `test__get_result_df`. ")
@pytest.mark.skip(
reason="Skip since this is not in a spark session. This test should alreayd be covered by `test__get_result_df`. "
)
def test__get_result_df__with_spark_session(
workspace_dir: str,
spark: SparkSession,
Expand Down
1 change: 1 addition & 0 deletions feathr_project/test/unit/utils/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Currently, we only test the negative cases, running on non-notebook platform.
We may submit the test codes to databricks and synapse cluster to confirm the behavior in the future.
"""

from feathr.utils.platform import is_jupyter, is_databricks, is_synapse


Expand Down

0 comments on commit be93db8

Please sign in to comment.