Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest): always resolve platform for browse path v2 #12045

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion metadata-ingestion/src/datahub/ingestion/api/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,15 @@ def close(self) -> None:

def _infer_platform(self) -> Optional[str]:
config = self.get_config()
return (
platform = (
getattr(config, "platform_name", None)
or getattr(self, "platform", None)
or getattr(config, "platform", None)
)
if platform is None and hasattr(self, "get_platform_id"):
platform = type(self).get_platform_id()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_platform_id comes from the decorators, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This was observed for dremio that platform_instance entry was not getting added in browse path v2.


return platform

def _get_browse_path_processor(self, dry_run: bool) -> MetadataWorkUnitProcessor:
config = self.get_config()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _init_job_id(self) -> JobId:
platform: Optional[str] = None
source_class = type(self.source)
if hasattr(source_class, "get_platform_name"):
platform = source_class.get_platform_name() # type: ignore
platform = source_class.get_platform_name()

# Default name for everything else
job_name_suffix = self.get_job_name_suffix()
Expand Down
Loading