From 0ece3667021ff61e6b073f951686c9d0f9953267 Mon Sep 17 00:00:00 2001 From: Pat Nadolny Date: Wed, 10 Jul 2024 09:56:44 -0400 Subject: [PATCH] fix skip limit --- hub_utils/utilities.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hub_utils/utilities.py b/hub_utils/utilities.py index e178cec..53fd48a 100644 --- a/hub_utils/utilities.py +++ b/hub_utils/utilities.py @@ -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(","):