Skip to content

Commit

Permalink
fix skip limit
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 committed Jul 10, 2024
1 parent da18267 commit 0ece366
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hub_utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ def get_variant_names(self, plugin_type, metadata_type, skip, limit):
from hub_utils.yaml_lint import find_all_yamls

formatted_output = []
for index, yaml_file in enumerate(find_all_yamls(f_path=f"{self.hub_root}/_data/meltano/")):
for yaml_file in find_all_yamls(f_path=f"{self.hub_root}/_data/meltano/"):
# Pagination mechanism
if index < skip:
continue
if index == limit:
if len(formatted_output) == skip:
# Clear list and continue iterating
formatted_output = []
if len(formatted_output) == limit:
break
data = self._read_yaml(yaml_file)
if plugin_type and yaml_file.split("/")[-3] not in plugin_type.split(","):
Expand Down

0 comments on commit 0ece366

Please sign in to comment.