Skip to content

Commit

Permalink
[Feature store] Changed fset status targets to have partitioning rela…
Browse files Browse the repository at this point in the history
…ted fields (mlrun#2285)
  • Loading branch information
theSaarco authored Aug 23, 2022
1 parent e96ef45 commit 6973427
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mlrun/datastore/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,15 @@ def update_resource_status(self, status="", producer=None, size=None):
target.updated = now_date().isoformat()
target.size = size
target.producer = producer or target.producer
# Copy partitioning-related fields to the status, since these are needed if reading the actual data that
# is related to the specific target.
# TODO - instead of adding more fields to the status targets, we should consider changing any functionality
# that depends on "spec-fields" to use a merge between the status and the spec targets. One such place
# is the fset.to_dataframe() function.
target.partitioned = self.partitioned
target.key_bucketing_number = self.key_bucketing_number
target.partition_cols = self.partition_cols
target.time_partitioning_granularity = self.time_partitioning_granularity

self._resource.status.update_target(target)
return target
Expand Down
4 changes: 4 additions & 0 deletions mlrun/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,10 @@ class DataTarget(DataTargetBase):
"size",
"last_written",
"run_id",
"partitioned",
"key_bucketing_number",
"partition_cols",
"time_partitioning_granularity",
]

def __init__(
Expand Down

0 comments on commit 6973427

Please sign in to comment.