Skip to content
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

Matching all listed tags instead of any when calling #899

Merged
merged 3 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Fixes
- Fix computing of a multipart upload chunk size ([#897](https://github.com/neptune-ai/neptune-client/pull/897))
- Matching all listed tags instead of any when calling `fetch_runs_table` ([#899](https://github.com/neptune-ai/neptune-client/pull/899))

## neptune-client 0.16.2

Expand Down
14 changes: 7 additions & 7 deletions e2e_tests/standard/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,30 +177,30 @@ def test_add_and_remove_tags(self, container: MetadataContainer):

class TestFetchTable(BaseE2ETest):
def test_fetch_runs_table(self, environment):
tag = str(uuid.uuid4())
tag1, tag2 = str(uuid.uuid4()), str(uuid.uuid4())

with neptune.init_run(project=environment.project) as run:
run["sys/tags"].add(tag)
run["sys/tags"].add(tag1)
run["sys/tags"].add(tag2)
run["value"] = 12
run.sync()

with neptune.init_run(project=environment.project) as run:
run["sys/tags"].add(tag)
run["sys/tags"].add(tag2)
run["another/value"] = "testing"
run.sync()

# wait for the elasticsearch cache to fill
# wait for the cache to fill
time.sleep(5)

project = neptune.get_project(name=environment.project)

runs_table = sorted(
project.fetch_runs_table(tag=tag).to_rows(),
project.fetch_runs_table(tag=[tag1, tag2]).to_rows(),
key=lambda r: r.get_attribute_value("sys/id"),
)
assert len(runs_table) == 2
assert len(runs_table) == 1
assert runs_table[0].get_attribute_value("value") == 12
assert runs_table[1].get_attribute_value("another/value") == "testing"

@pytest.mark.parametrize("container", ["model"], indirect=True)
def test_fetch_model_versions_table(self, container: Model, environment):
Expand Down
2 changes: 1 addition & 1 deletion neptune/new/metadata_containers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def fetch_runs_table(
)
for tag in tags
],
aggregator=NQLAggregator.OR,
aggregator=NQLAggregator.AND,
)
)

Expand Down