Skip to content

Commit

Permalink
Matching all listed tags instead of any when calling (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky authored and normandy7 committed May 23, 2022
1 parent ef29d42 commit 7ca4117
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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

0 comments on commit 7ca4117

Please sign in to comment.