Skip to content

Commit

Permalink
[bug] stop quering for entities once zero are returned (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ada Draginda authored Mar 3, 2023
1 parent b8bffc9 commit 864bf97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'
[project]
name = 'datahub_tools'
description = 'Python tools for working with DataHub'
version = '1.0.1'
version = '1.0.2'
readme = 'README.md'
requires-python = '>=3.7'
dependencies = [
Expand Down
7 changes: 7 additions & 0 deletions src/datahub_tools/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from dataclasses import dataclass
from typing import Any, Dict, List, Optional

import datahub.emitter.mce_builder as builder
import jmespath


Expand Down Expand Up @@ -68,6 +69,12 @@ def has_tags(self) -> bool:
def has_owners(self) -> bool:
return bool(self.owners)

def get_platform(self):
return builder.dataset_urn_to_key(self.urn).platform

def get_name(self):
return builder.dataset_urn_to_key(self.urn).name

def get_priority(self) -> Optional[str]:
"""
return the priority of the dataset, as reflected by its tags (priority tags look like `Priority: P0`)
Expand Down
2 changes: 2 additions & 0 deletions src/datahub_tools/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ def get_datahub_entities(
else:
raise e
else:
if not dh_entities:
break
_start += _chunk_size
# important: you can get more than one URN per qualified name because there
# may be more than one platform (e.g. dbt, snowflake, etc.).
Expand Down

0 comments on commit 864bf97

Please sign in to comment.