From d3255eae635c3452a7a79d0ef14a6d735860c633 Mon Sep 17 00:00:00 2001 From: Robin Andersson Date: Tue, 17 Oct 2023 22:50:03 +0200 Subject: [PATCH] [HWORKS-798] Add **kwargs to python client libraries (#1129) --- python/hsfs/code.py | 1 + .../hsfs/constructor/external_feature_group_alias.py | 2 +- python/hsfs/constructor/filter.py | 6 ++++-- python/hsfs/constructor/fs_query.py | 1 + python/hsfs/constructor/hudi_feature_group_alias.py | 1 + python/hsfs/constructor/join.py | 2 +- .../hsfs/constructor/prepared_statement_parameter.py | 2 +- python/hsfs/constructor/query.py | 1 + python/hsfs/constructor/serving_prepared_statement.py | 1 + python/hsfs/core/deltastreamer_jobconf.py | 2 +- python/hsfs/core/execution.py | 1 + python/hsfs/core/explicit_provenance.py | 1 + python/hsfs/core/ingestion_job.py | 1 + python/hsfs/core/inode.py | 2 +- python/hsfs/core/job.py | 1 + python/hsfs/core/job_configuration.py | 1 + python/hsfs/expectation_suite.py | 1 + python/hsfs/feature.py | 1 + python/hsfs/feature_group.py | 4 ++++ python/hsfs/feature_group_commit.py | 1 + python/hsfs/feature_store.py | 1 + python/hsfs/feature_view.py | 1 + python/hsfs/ge_validation_result.py | 1 + python/hsfs/serving_key.py | 1 + python/hsfs/split_statistics.py | 10 +++++++++- python/hsfs/statistics.py | 1 + python/hsfs/statistics_config.py | 1 + python/hsfs/storage_connector.py | 11 ++++++++++- python/hsfs/tag.py | 1 + python/hsfs/training_dataset.py | 1 + python/hsfs/training_dataset_feature.py | 1 + python/hsfs/training_dataset_split.py | 8 +++++++- python/hsfs/transformation_function.py | 1 + python/hsfs/transformation_function_attached.py | 1 + python/hsfs/user.py | 1 + python/hsfs/validation_report.py | 1 + 36 files changed, 65 insertions(+), 10 deletions(-) diff --git a/python/hsfs/code.py b/python/hsfs/code.py index 60ee5fae16..5d4f7c696f 100644 --- a/python/hsfs/code.py +++ b/python/hsfs/code.py @@ -31,6 +31,7 @@ def __init__( items=None, count=None, type=None, + **kwargs, ): self._commit_time = commit_time self._application_id = application_id diff --git a/python/hsfs/constructor/external_feature_group_alias.py b/python/hsfs/constructor/external_feature_group_alias.py index 5b71fd9331..650f6e8808 100644 --- a/python/hsfs/constructor/external_feature_group_alias.py +++ b/python/hsfs/constructor/external_feature_group_alias.py @@ -20,7 +20,7 @@ class ExternalFeatureGroupAlias: - def __init__(self, on_demand_feature_group, alias): + def __init__(self, on_demand_feature_group, alias, **kwargs): if not on_demand_feature_group["spine"]: self._on_demand_feature_group = ( feature_group.ExternalFeatureGroup.from_response_json( diff --git a/python/hsfs/constructor/filter.py b/python/hsfs/constructor/filter.py index 0f99ab4d46..a6d952b0f0 100644 --- a/python/hsfs/constructor/filter.py +++ b/python/hsfs/constructor/filter.py @@ -29,7 +29,7 @@ class Filter: IN = "IN" LK = "LIKE" - def __init__(self, feature, condition, value): + def __init__(self, feature, condition, value, **kwargs): self._feature = feature self._condition = condition self._value = value @@ -91,7 +91,9 @@ class Logic: OR = "OR" SINGLE = "SINGLE" - def __init__(self, type, left_f=None, right_f=None, left_l=None, right_l=None): + def __init__( + self, type, left_f=None, right_f=None, left_l=None, right_l=None, **kwargs + ): self._type = type self._left_f = left_f self._right_f = right_f diff --git a/python/hsfs/constructor/fs_query.py b/python/hsfs/constructor/fs_query.py index 340dfb1d20..d80d722611 100644 --- a/python/hsfs/constructor/fs_query.py +++ b/python/hsfs/constructor/fs_query.py @@ -32,6 +32,7 @@ def __init__( expand=None, items=None, type=None, + **kwargs, ): self._query = query self._query_online = query_online diff --git a/python/hsfs/constructor/hudi_feature_group_alias.py b/python/hsfs/constructor/hudi_feature_group_alias.py index 47b4e2d096..fe8793f0c1 100644 --- a/python/hsfs/constructor/hudi_feature_group_alias.py +++ b/python/hsfs/constructor/hudi_feature_group_alias.py @@ -26,6 +26,7 @@ def __init__( alias, left_feature_group_end_timestamp=None, left_feature_group_start_timestamp=None, + **kwargs, ): self._feature_group = feature_group_module.FeatureGroup.from_response_json( feature_group diff --git a/python/hsfs/constructor/join.py b/python/hsfs/constructor/join.py index b27ad573d1..4354a75682 100644 --- a/python/hsfs/constructor/join.py +++ b/python/hsfs/constructor/join.py @@ -28,7 +28,7 @@ class Join: LEFT_SEMI_JOIN = "LEFT_SEMI_JOIN" COMMA = "COMMA" - def __init__(self, query, on, left_on, right_on, join_type, prefix): + def __init__(self, query, on, left_on, right_on, join_type, prefix, **kwargs): self._query = query self._on = util.parse_features(on) self._left_on = util.parse_features(left_on) diff --git a/python/hsfs/constructor/prepared_statement_parameter.py b/python/hsfs/constructor/prepared_statement_parameter.py index 07b6aae1ec..79a3918ae0 100644 --- a/python/hsfs/constructor/prepared_statement_parameter.py +++ b/python/hsfs/constructor/prepared_statement_parameter.py @@ -20,7 +20,7 @@ class PreparedStatementParameter: - def __init__(self, name=None, index=None, type=None, href=None): + def __init__(self, name=None, index=None, type=None, href=None, **kwargs): self._name = name self._index = index diff --git a/python/hsfs/constructor/query.py b/python/hsfs/constructor/query.py index b90c1d4e1c..a43ec81f91 100644 --- a/python/hsfs/constructor/query.py +++ b/python/hsfs/constructor/query.py @@ -54,6 +54,7 @@ def __init__( left_feature_group_end_time=None, joins=None, filter=None, + **kwargs, ): self._feature_store_name = feature_store_name self._feature_store_id = feature_store_id diff --git a/python/hsfs/constructor/serving_prepared_statement.py b/python/hsfs/constructor/serving_prepared_statement.py index 8fe705a1c3..9e9060f404 100644 --- a/python/hsfs/constructor/serving_prepared_statement.py +++ b/python/hsfs/constructor/serving_prepared_statement.py @@ -32,6 +32,7 @@ def __init__( items=None, count=None, href=None, + **kwargs, ): self._feature_group_id = feature_group_id self._prepared_statement_index = prepared_statement_index diff --git a/python/hsfs/core/deltastreamer_jobconf.py b/python/hsfs/core/deltastreamer_jobconf.py index 9e70ab7c80..c38daf7469 100644 --- a/python/hsfs/core/deltastreamer_jobconf.py +++ b/python/hsfs/core/deltastreamer_jobconf.py @@ -20,7 +20,7 @@ class DeltaStreamerJobConf: - def __init__(self, options, spark_options): + def __init__(self, options, spark_options, **kwargs): self._options = options self._spark_options = spark_options diff --git a/python/hsfs/core/execution.py b/python/hsfs/core/execution.py index a07138ebb6..5a1cfc3219 100644 --- a/python/hsfs/core/execution.py +++ b/python/hsfs/core/execution.py @@ -37,6 +37,7 @@ def __init__( monitoring=None, type=None, href=None, + **kwargs, ): self._id = id self._final_status = final_status diff --git a/python/hsfs/core/explicit_provenance.py b/python/hsfs/core/explicit_provenance.py index 9dae009789..4bf607c98b 100644 --- a/python/hsfs/core/explicit_provenance.py +++ b/python/hsfs/core/explicit_provenance.py @@ -36,6 +36,7 @@ def __init__( meta_type, href=None, exception_cause=None, + **kwargs, ): self._feature_store_name = feature_store_name self._name = name diff --git a/python/hsfs/core/ingestion_job.py b/python/hsfs/core/ingestion_job.py index bf19d1e3cc..4f0dbca7e8 100644 --- a/python/hsfs/core/ingestion_job.py +++ b/python/hsfs/core/ingestion_job.py @@ -28,6 +28,7 @@ def __init__( items=None, count=None, type=None, + **kwargs, ): self._data_path = data_path self._job = Job.from_response_json(job) diff --git a/python/hsfs/core/inode.py b/python/hsfs/core/inode.py index 414c161a34..110bbc547f 100644 --- a/python/hsfs/core/inode.py +++ b/python/hsfs/core/inode.py @@ -17,7 +17,7 @@ class Inode: - def __init__(self, href=None, attributes=None, zip_state=None, tags=None): + def __init__(self, href=None, attributes=None, zip_state=None, tags=None, **kwargs): self._path = attributes["path"] @classmethod diff --git a/python/hsfs/core/job.py b/python/hsfs/core/job.py index 5876cc880a..3f3ffa872a 100644 --- a/python/hsfs/core/job.py +++ b/python/hsfs/core/job.py @@ -35,6 +35,7 @@ def __init__( expand=None, items=None, count=None, + **kwargs, ): self._id = id self._name = name diff --git a/python/hsfs/core/job_configuration.py b/python/hsfs/core/job_configuration.py index 51168f750d..dd7a55fa2e 100644 --- a/python/hsfs/core/job_configuration.py +++ b/python/hsfs/core/job_configuration.py @@ -32,6 +32,7 @@ def __init__( dynamic_allocation=True, dynamic_min_executors=1, dynamic_max_executors=2, + **kwargs, ): self._am_memory = am_memory self._am_cores = am_cores diff --git a/python/hsfs/expectation_suite.py b/python/hsfs/expectation_suite.py index db9acffd0e..0de4d5de7c 100644 --- a/python/hsfs/expectation_suite.py +++ b/python/hsfs/expectation_suite.py @@ -52,6 +52,7 @@ def __init__( count=None, type=None, created=None, + **kwargs, ): self._id = id self._expectation_suite_name = expectation_suite_name diff --git a/python/hsfs/feature.py b/python/hsfs/feature.py index 5995959595..213564eb60 100644 --- a/python/hsfs/feature.py +++ b/python/hsfs/feature.py @@ -42,6 +42,7 @@ def __init__( default_value=None, feature_group_id=None, feature_group=None, + **kwargs, ): self._name = name.lower() self._type = type diff --git a/python/hsfs/feature_group.py b/python/hsfs/feature_group.py index 1f321203c9..5cb028273e 100644 --- a/python/hsfs/feature_group.py +++ b/python/hsfs/feature_group.py @@ -71,6 +71,7 @@ def __init__( online_topic_name=None, topic_name=None, deprecated=False, + **kwargs, ): self._version = version self._name = name @@ -1468,6 +1469,7 @@ def __init__( href=None, delta_streamer_job_conf=None, deprecated=False, + **kwargs, ): super().__init__( name, @@ -2662,6 +2664,7 @@ def __init__( topic_name=None, spine=False, deprecated=False, + **kwargs, ): super().__init__( name, @@ -3015,6 +3018,7 @@ def __init__( spine=True, dataframe="spine", deprecated=False, + **kwargs, ): super().__init__( name, diff --git a/python/hsfs/feature_group_commit.py b/python/hsfs/feature_group_commit.py index 6c4b48f9f9..8cf26c569a 100644 --- a/python/hsfs/feature_group_commit.py +++ b/python/hsfs/feature_group_commit.py @@ -35,6 +35,7 @@ def __init__( items=None, count=None, href=None, + **kwargs, ): self._commitid = commitid self._commit_date_string = commit_date_string diff --git a/python/hsfs/feature_store.py b/python/hsfs/feature_store.py index adc88d0a7f..61c9409d0f 100644 --- a/python/hsfs/feature_store.py +++ b/python/hsfs/feature_store.py @@ -70,6 +70,7 @@ def __init__( online_featurestore_name=None, mysql_server_endpoint=None, online_featurestore_size=None, + **kwargs, ): self._id = featurestore_id self._name = featurestore_name diff --git a/python/hsfs/feature_view.py b/python/hsfs/feature_view.py index 0720511684..b5c5c079b3 100644 --- a/python/hsfs/feature_view.py +++ b/python/hsfs/feature_view.py @@ -59,6 +59,7 @@ def __init__( transformation_functions: Optional[Dict[str, TransformationFunction]] = {}, featurestore_name=None, serving_keys: Optional[List[ServingKey]] = None, + **kwargs, ): self._name = name self._id = id diff --git a/python/hsfs/ge_validation_result.py b/python/hsfs/ge_validation_result.py index 1e3b447702..fa8c10f8a7 100644 --- a/python/hsfs/ge_validation_result.py +++ b/python/hsfs/ge_validation_result.py @@ -46,6 +46,7 @@ def __init__( items=None, count=None, type=None, + **kwargs, ): self._id = id self._success = success diff --git a/python/hsfs/serving_key.py b/python/hsfs/serving_key.py index e75cede784..bc0b1332e8 100644 --- a/python/hsfs/serving_key.py +++ b/python/hsfs/serving_key.py @@ -29,6 +29,7 @@ def __init__( prefix="", join_on=None, ignore_prefix=False, + **kwargs, ): self._feature_name = feature_name self._feature_group = feature_group diff --git a/python/hsfs/split_statistics.py b/python/hsfs/split_statistics.py index 6005ddefbb..449d713a4a 100644 --- a/python/hsfs/split_statistics.py +++ b/python/hsfs/split_statistics.py @@ -22,7 +22,15 @@ class SplitStatistics: def __init__( - self, name, content, href=None, expand=None, items=None, count=None, type=None + self, + name, + content, + href=None, + expand=None, + items=None, + count=None, + type=None, + **kwargs ): self._name = name if not isinstance(content, dict): diff --git a/python/hsfs/statistics.py b/python/hsfs/statistics.py index 14b899fac2..36748c8d6b 100644 --- a/python/hsfs/statistics.py +++ b/python/hsfs/statistics.py @@ -34,6 +34,7 @@ def __init__( items=None, count=None, type=None, + **kwargs, ): self._commit_time = commit_time self._feature_group_commit_id = feature_group_commit_id diff --git a/python/hsfs/statistics_config.py b/python/hsfs/statistics_config.py index 446d5db710..ff0c16f83d 100644 --- a/python/hsfs/statistics_config.py +++ b/python/hsfs/statistics_config.py @@ -28,6 +28,7 @@ def __init__( histograms=False, exact_uniqueness=False, columns=[], + **kwargs, ): self._enabled = enabled # use setters for input validation diff --git a/python/hsfs/storage_connector.py b/python/hsfs/storage_connector.py index a535291766..5427f47ed8 100644 --- a/python/hsfs/storage_connector.py +++ b/python/hsfs/storage_connector.py @@ -36,7 +36,7 @@ class StorageConnector(ABC): GCS = "GCS" BIGQUERY = "BIGQUERY" - def __init__(self, id, name, description, featurestore_id): + def __init__(self, id, name, description, featurestore_id, **kwargs): self._id = id self._name = name self._description = description @@ -151,6 +151,7 @@ def __init__( # members specific to type of connector hopsfs_path=None, dataset_name=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -186,6 +187,7 @@ def __init__( session_token=None, iam_role=None, arguments=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -333,6 +335,7 @@ def __init__( iam_role=None, arguments=None, expiration=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -509,6 +512,7 @@ def __init__( account_name=None, container_name=None, spark_options=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -644,6 +648,7 @@ def __init__( warehouse=None, application=None, sf_options=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -826,6 +831,7 @@ def __init__( # members specific to type of connector connection_string=None, arguments=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -910,6 +916,7 @@ def __init__( ssl_endpoint_identification_algorithm=None, options=None, external_kafka=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -1204,6 +1211,7 @@ def __init__( algorithm=None, encryption_key=None, encryption_key_hash=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) @@ -1345,6 +1353,7 @@ def __init__( query_project=None, materialization_dataset=None, arguments=None, + **kwargs, ): super().__init__(id, name, description, featurestore_id) self._key_path = key_path diff --git a/python/hsfs/tag.py b/python/hsfs/tag.py index 2a79e0364a..a82a5d6f15 100644 --- a/python/hsfs/tag.py +++ b/python/hsfs/tag.py @@ -31,6 +31,7 @@ def __init__( items=None, count=None, type=None, + **kwargs, ): self._name = name self._value = value diff --git a/python/hsfs/training_dataset.py b/python/hsfs/training_dataset.py index e7d30c8164..b06bf7c562 100644 --- a/python/hsfs/training_dataset.py +++ b/python/hsfs/training_dataset.py @@ -81,6 +81,7 @@ def __init__( train_split=None, time_split_size=None, extra_filter=None, + **kwargs, ): self._id = id self._name = name diff --git a/python/hsfs/training_dataset_feature.py b/python/hsfs/training_dataset_feature.py index 71005580c3..8ab02b1546 100644 --- a/python/hsfs/training_dataset_feature.py +++ b/python/hsfs/training_dataset_feature.py @@ -31,6 +31,7 @@ def __init__( feature_group_feature_name=None, label=False, transformation_function=None, + **kwargs, ): self._name = name.lower() self._type = type diff --git a/python/hsfs/training_dataset_split.py b/python/hsfs/training_dataset_split.py index 5924243e56..444197ea7b 100644 --- a/python/hsfs/training_dataset_split.py +++ b/python/hsfs/training_dataset_split.py @@ -27,7 +27,13 @@ class TrainingDatasetSplit: TEST = "test" def __init__( - self, name, split_type, percentage=None, start_time=None, end_time=None + self, + name, + split_type, + percentage=None, + start_time=None, + end_time=None, + **kwargs ): self._name = name self._percentage = percentage diff --git a/python/hsfs/transformation_function.py b/python/hsfs/transformation_function.py index 50ad580709..2e878e2539 100644 --- a/python/hsfs/transformation_function.py +++ b/python/hsfs/transformation_function.py @@ -37,6 +37,7 @@ def __init__( items=None, count=None, href=None, + **kwargs, ): self._id = id self._featurestore_id = featurestore_id diff --git a/python/hsfs/transformation_function_attached.py b/python/hsfs/transformation_function_attached.py index ad5ef2b173..e3670b1506 100644 --- a/python/hsfs/transformation_function_attached.py +++ b/python/hsfs/transformation_function_attached.py @@ -26,6 +26,7 @@ def __init__( items=None, count=None, href=None, + **kwargs, ): self._name = name self._transformation_function = ( diff --git a/python/hsfs/user.py b/python/hsfs/user.py index 4ec4c975bb..a1ab607a56 100644 --- a/python/hsfs/user.py +++ b/python/hsfs/user.py @@ -39,6 +39,7 @@ def __init__( user_account_type=None, num_active_projects=None, num_remaining_projects=None, + **kwargs, ): self._username = username self._email = email diff --git a/python/hsfs/validation_report.py b/python/hsfs/validation_report.py index 25aa0b099f..05c8a0198d 100644 --- a/python/hsfs/validation_report.py +++ b/python/hsfs/validation_report.py @@ -45,6 +45,7 @@ def __init__( type=None, validation_time=None, ingestion_result="UNKNOWN", + **kwargs, ): self._id = id self._success = success