Skip to content

Commit

Permalink
[Datastore] Align DataFrameSource key_field column name to other sour…
Browse files Browse the repository at this point in the history
…ces (#959)
  • Loading branch information
dinal committed May 24, 2021
1 parent 673ff5a commit 8326c36
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mlrun/datastore/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_source_step(source, key_fields=None, time_field=None):
"""initialize the source driver"""
if hasattr(source, "to_csv"):
source = DataFrameSource(source)
if not key_fields and not source.key_fields:
if not key_fields and not source.key_field:
raise mlrun.errors.MLRunInvalidArgumentError("key column is not defined")
return source.to_step(key_fields, time_field)

Expand Down Expand Up @@ -183,17 +183,17 @@ def to_step(self, key_field=None, time_field=None):
class DataFrameSource:
support_storey = True

def __init__(self, df, key_fields=None, time_field=None):
def __init__(self, df, key_field=None, time_field=None):
self._df = df
self.key_fields = key_fields
self.key_field = key_field
self.time_field = time_field

def to_step(self, key_fields=None, time_field=None):
def to_step(self, key_field=None, time_field=None):
import storey

return storey.DataframeSource(
dfs=self._df,
key_field=self.key_fields or key_fields,
key_field=self.key_field or key_field,
time_field=self.time_field or time_field,
)

Expand Down

0 comments on commit 8326c36

Please sign in to comment.