Skip to content

Fix: Corrected position of arguments in _par #2037

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

Merged
merged 2 commits into from
Dec 8, 2022
Merged
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions metadata/metadata_service/proxy/gremlin_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,8 @@ def _get_edge_type_from_user_resource_rel_type(self, relation: UserResourceRel)

raise NotImplementedError(f"Don't know how to handle UserResourceRel={relation}")

def _parse_lineage(self, resource_type: ResourceType, type_: str, upstream_tables: List[LineageItem], path: Path,
downstream_tables: List[LineageItem]) -> Tuple[List[LineageItem], List[LineageItem]]:
def _parse_lineage(self, resource_type: ResourceType, type_: str, upstream_tables: List[LineageItem],
Copy link
Member

Choose a reason for hiding this comment

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

what is the main reason of the argument swap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, parse_lineage function accepted arguments in the wrong order as it was called on line 2038. There are two possible fixes for this:

  1. Align the order of the arguments in parse_lineage and line 2038.
  2. Add kwargs

Technically, either one of the above fixes would work but I have included both.

downstream_tables: List[LineageItem], path: Path) -> Tuple[List[LineageItem], List[LineageItem]]:
"""
Helper function to parse the lineage path
:param resource_type: Type of the entity for which lineage is being retrieved
Expand Down Expand Up @@ -2035,8 +2035,11 @@ def get_lineage(self, *,
if path_list == []:
continue
for path in path_list:
upstream_tables, downstream_tables = self._parse_lineage(resource_type, type_,
upstream_tables, downstream_tables, path)
upstream_tables, downstream_tables = self._parse_lineage(resource_type=resource_type,
type_=type_,
upstream_tables=upstream_tables,
downstream_tables=downstream_tables,
path=path)

return Lineage(**{"key": id,
"upstream_entities": upstream_tables,
Expand Down