Skip to content

Commit

Permalink
Make inject_attrs optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jbusecke committed Apr 22, 2024
1 parent 7b7dc5f commit 81feb57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leap_data_management_utils/data_management_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,14 @@ def expand(self, pcoll: beam.PCollection) -> beam.PCollection:

@dataclass
class InjectAttrs(beam.PTransform):
inject_attrs: dict
inject_attrs: dict = None
add_provenance: bool = True

# add a post_init method to add the provenance attributes
def __post_init__(self):
if self.inject_attrs is None:
self.inject_attrs = {}

if self.add_provenance:
git_url_hash = get_github_commit_url()
timestamp = datetime.now(timezone.utc).isoformat()
Expand Down

0 comments on commit 81feb57

Please sign in to comment.