We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Querying records that contain a given meta value does not work. MWE:
from pyauditor import AuditorClientBuilder, MetaOperator, MetaQuery, QueryBuilder, Record, Meta, Score, Component import datetime def add_records(site_id, client): for i in range(0, 24): record_id = f"record-{i:02d}-{site_id}" start = datetime.datetime(2022, 10, 8, i, 0, 0, 0, tzinfo=datetime.timezone.utc) stop = datetime.datetime(2022, 10, 9, i, 0, 0, 0, tzinfo=datetime.timezone.utc) meta = ( Meta() .insert("site_id", [site_id]) .insert("group_id", ["group_1"]) .insert("nodes", ["node1", "node2"]) ) score1 = Score("HEPSPEC", 1.0) component1 = Component("comp-1", 10).with_score(score1) record = ( Record(record_id, start) .with_stop_time(stop) .with_meta(meta) .with_component(component1) ) client.add(record) builder = AuditorClientBuilder() builder = builder.address("127.0.0.1", 8000) client = builder.build_blocking() add_records("site_A", client) add_records("site_B", client) meta_operator = MetaOperator().contains("site_B") meta_query = MetaQuery().meta_operator("site_id", meta_operator) query_string = QueryBuilder().with_meta_query(meta_query).build() print(query_string) records = client.advanced_query(query_string) print(len(records))
This returns 48, but it should return 24.
48
24
We didn't catch this in our unit/integration tests, because we only test the meta contains operator only if there is one unique value in the meta key:
Instead, we should create records with different values for a meta entry and then check if we select a subset of records.
Originally reported by @dirksammel
The text was updated successfully, but these errors were encountered:
Closed by #645
Sorry, something went wrong.
raghuvar-vijay
No branches or pull requests
Querying records that contain a given meta value does not work. MWE:
This returns
48
, but it should return24
.We didn't catch this in our unit/integration tests, because we only test the meta contains operator only if there is one unique value in the meta key:
Instead, we should create records with different values for a meta entry and then check if we select a subset of records.
Originally reported by @dirksammel
The text was updated successfully, but these errors were encountered: