diff --git a/cmd/lakectl/cmd/common_helpers.go b/cmd/lakectl/cmd/common_helpers.go index c8993db7adc..c66a5e771c8 100644 --- a/cmd/lakectl/cmd/common_helpers.go +++ b/cmd/lakectl/cmd/common_helpers.go @@ -41,9 +41,10 @@ const ( internalPageSize = 1000 // when retrieving all records, use this page size under the hood defaultAmountArgumentValue = 100 // when no amount is specified, use this value for the argument - // when using --no-merges & amount, this const is the upper limit to use huristic. + // when using --no-merges & amount, this const is the upper limit to use heuristic. // The heuristic asks for 3*amount results since some will filter out maxAmountNoMerges = 333 + noMergesHeuristic = 3 defaultPollInterval = 3 * time.Second // default interval while pulling tasks status minimumPollInterval = time.Second // minimum interval while pulling tasks status diff --git a/cmd/lakectl/cmd/log.go b/cmd/lakectl/cmd/log.go index 51db0629a06..36df483f4af 100644 --- a/cmd/lakectl/cmd/log.go +++ b/cmd/lakectl/cmd/log.go @@ -116,7 +116,7 @@ var logCmd = &cobra.Command{ } // case --no-merges & --amount, ask for more results since some will filter out if noMerges && amountForPagination < maxAmountNoMerges { - amountForPagination *= 3 + amountForPagination *= noMergesHeuristic } logCommitsParams := &apigen.LogCommitsParams{ After: apiutil.Ptr(apigen.PaginationAfter(after)), @@ -172,8 +172,8 @@ var logCmd = &cobra.Command{ // case --no-merges, filter commits and subtract that amount from amount desired if noMerges { data.Commits = filterMergeCommits(data.Commits) - amount -= len(data.Commits) } + amount -= len(data.Commits) if dot { graph.Write(data.Commits) diff --git a/esti/lakectl_test.go b/esti/lakectl_test.go index a1a263b25b7..271cbc2f806 100644 --- a/esti/lakectl_test.go +++ b/esti/lakectl_test.go @@ -339,7 +339,6 @@ func TestLakectlMergeAndStrategies(t *testing.T) { } func TestLakectlLogNoMergesWithCommitsAndMerges(t *testing.T) { - repoName := generateUniqueRepositoryName() storage := generateUniqueStorageNamespace(repoName) vars := map[string]string{