Skip to content

Commit

Permalink
rename to fqn
Browse files Browse the repository at this point in the history
  • Loading branch information
NoyaArie committed Jun 19, 2023
1 parent 1412eae commit 575b474
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions elementary/monitor/api/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ def _normalize_dbt_artifact_dict(
normalized_artifact["normalized_full_path"] = self._normalize_artifact_path(
artifact
)
normalized_artifact["fully_qualified_name"] = self._fully_qualified_name(
artifact
)
normalized_artifact["fqn"] = self._fqn(artifact)

return schema_to_normalized_schema_map[type(artifact)](**normalized_artifact)

Expand Down Expand Up @@ -240,20 +238,20 @@ def _normalize_artifact_path(
return os.path.sep.join(splited_artifact_path)

@classmethod
def _fully_qualified_name(
def _fqn(
cls,
artifact: Union[ArtifactSchemaType],
) -> str:
if isinstance(artifact, ExposureSchema):
path = (artifact.meta or {}).get("path")
name = artifact.label or artifact.name
full_qualified_name = f"{path}/{name}" if path else name
return full_qualified_name
fqn = f"{path}/{name}" if path else name
return fqn

full_qualified_name = (
fqn = (
f"{artifact.database_name}.{artifact.schema_name}.{artifact.table_name}"
if artifact.database_name is not None and artifact.schema_name is not None
else artifact.table_name
)

return full_qualified_name
return fqn
2 changes: 1 addition & 1 deletion elementary/monitor/api/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NormalizedArtifactSchema(ExtendedBaseModel):
# Currently its model_name to match the CLI UI.
model_name: str
normalized_full_path: str
fully_qualified_name: str
fqn: str

@validator("tags", pre=True)
def load_tags(cls, tags):
Expand Down

0 comments on commit 575b474

Please sign in to comment.