Skip to content

Commit

Permalink
[HWORKS-798] Add **kwargs to python client libraries (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzor92 authored Oct 17, 2023
1 parent 27d4746 commit d3255ea
Show file tree
Hide file tree
Showing 36 changed files with 65 additions and 10 deletions.
1 change: 1 addition & 0 deletions python/hsfs/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
items=None,
count=None,
type=None,
**kwargs,
):
self._commit_time = commit_time
self._application_id = application_id
Expand Down
2 changes: 1 addition & 1 deletion python/hsfs/constructor/external_feature_group_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions python/hsfs/constructor/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/constructor/fs_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(
expand=None,
items=None,
type=None,
**kwargs,
):
self._query = query
self._query_online = query_online
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/constructor/hudi_feature_group_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/hsfs/constructor/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/hsfs/constructor/prepared_statement_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions python/hsfs/constructor/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/constructor/serving_prepared_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/hsfs/core/deltastreamer_jobconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions python/hsfs/core/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(
monitoring=None,
type=None,
href=None,
**kwargs,
):
self._id = id
self._final_status = final_status
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/core/explicit_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(
meta_type,
href=None,
exception_cause=None,
**kwargs,
):
self._feature_store_name = feature_store_name
self._name = name
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/core/ingestion_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/hsfs/core/inode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(
expand=None,
items=None,
count=None,
**kwargs,
):
self._id = id
self._name = name
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/core/job_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/expectation_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
count=None,
type=None,
created=None,
**kwargs,
):
self._id = id
self._expectation_suite_name = expectation_suite_name
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
default_value=None,
feature_group_id=None,
feature_group=None,
**kwargs,
):
self._name = name.lower()
self._type = type
Expand Down
4 changes: 4 additions & 0 deletions python/hsfs/feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(
online_topic_name=None,
topic_name=None,
deprecated=False,
**kwargs,
):
self._version = version
self._name = name
Expand Down Expand Up @@ -1468,6 +1469,7 @@ def __init__(
href=None,
delta_streamer_job_conf=None,
deprecated=False,
**kwargs,
):
super().__init__(
name,
Expand Down Expand Up @@ -2662,6 +2664,7 @@ def __init__(
topic_name=None,
spine=False,
deprecated=False,
**kwargs,
):
super().__init__(
name,
Expand Down Expand Up @@ -3015,6 +3018,7 @@ def __init__(
spine=True,
dataframe="spine",
deprecated=False,
**kwargs,
):
super().__init__(
name,
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/feature_group_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(
items=None,
count=None,
href=None,
**kwargs,
):
self._commitid = commitid
self._commit_date_string = commit_date_string
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/ge_validation_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
items=None,
count=None,
type=None,
**kwargs,
):
self._id = id
self._success = success
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/serving_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
prefix="",
join_on=None,
ignore_prefix=False,
**kwargs,
):
self._feature_name = feature_name
self._feature_group = feature_group
Expand Down
10 changes: 9 additions & 1 deletion python/hsfs/split_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/statistics_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(
histograms=False,
exact_uniqueness=False,
columns=[],
**kwargs,
):
self._enabled = enabled
# use setters for input validation
Expand Down
11 changes: 10 additions & 1 deletion python/hsfs/storage_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -186,6 +187,7 @@ def __init__(
session_token=None,
iam_role=None,
arguments=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -333,6 +335,7 @@ def __init__(
iam_role=None,
arguments=None,
expiration=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -509,6 +512,7 @@ def __init__(
account_name=None,
container_name=None,
spark_options=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -644,6 +648,7 @@ def __init__(
warehouse=None,
application=None,
sf_options=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -910,6 +916,7 @@ def __init__(
ssl_endpoint_identification_algorithm=None,
options=None,
external_kafka=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -1204,6 +1211,7 @@ def __init__(
algorithm=None,
encryption_key=None,
encryption_key_hash=None,
**kwargs,
):
super().__init__(id, name, description, featurestore_id)

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
items=None,
count=None,
type=None,
**kwargs,
):
self._name = name
self._value = value
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/training_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(
train_split=None,
time_split_size=None,
extra_filter=None,
**kwargs,
):
self._id = id
self._name = name
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/training_dataset_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
feature_group_feature_name=None,
label=False,
transformation_function=None,
**kwargs,
):
self._name = name.lower()
self._type = type
Expand Down
8 changes: 7 additions & 1 deletion python/hsfs/training_dataset_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/hsfs/transformation_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(
items=None,
count=None,
href=None,
**kwargs,
):
self._id = id
self._featurestore_id = featurestore_id
Expand Down
Loading

0 comments on commit d3255ea

Please sign in to comment.