Skip to content

Commit

Permalink
fix parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro93 committed Jul 30, 2024
1 parent 1eedb5a commit 11b4eeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions metadata-ingestion/src/datahub/cli/put_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def put() -> None:
@click.option("--urn", required=True, type=str)
@click.option("-a", "--aspect", required=True, type=str)
@click.option("-d", "--aspect-data", required=True, type=str)
@click.option("--run-id", type=str, help="Run ID into which we should log the aspect.")
@click.option("--run-id", type=str, required=False, help="Run ID into which we should log the aspect.")
@upgrade.check_upgrade
@telemetry.with_telemetry()
def aspect(urn: str, aspect: str, aspect_data: str, run_id: str) -> None:
def aspect(urn: str, aspect: str, aspect_data: str, run_id: Optional[str]) -> None:
"""Update a single aspect of an entity"""

entity_type = guess_entity_type(urn)
Expand All @@ -49,6 +49,10 @@ def aspect(urn: str, aspect: str, aspect_data: str, run_id: str) -> None:

client = get_default_graph()

system_metadata = None
if run_id:
system_metadata=SystemMetadataClass(runId=run_id),

# TODO: Replace with client.emit, requires figuring out the correct subsclass of _Aspect to create from the data
status = post_entity(
client._session,
Expand All @@ -57,7 +61,7 @@ def aspect(urn: str, aspect: str, aspect_data: str, run_id: str) -> None:
aspect_name=aspect,
entity_type=entity_type,
aspect_value=aspect_obj,
system_metadata=SystemMetadataClass(runId=run_id),
system_metadata=system_metadata,
)
click.secho(f"Update succeeded with status {status}", fg="green")

Expand Down

0 comments on commit 11b4eeb

Please sign in to comment.