Skip to content

Commit f807eee

Browse files
committed
PY-207 nq.runs, nq.Filter, nq.Attribute, nq.AttributeFilter
I want to make working with nq easier by allowing to import runs, Filter, Attribute and AttributeFilter straight from `neptune_query` (often aliased as `nq`): ``` import neptune_query as nq nq.runs.list_attributes( runs=nq.Filter.eq(nq.Attribute("sys/name"), "my-run"), attributes=nq.AttributeFilter(name="abc/"), ) ```
1 parent fdc3c27 commit f807eee

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

src/neptune_query/__init__.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@
1515
#
1616

1717
__all__ = [
18-
"set_api_token",
19-
"list_experiments",
20-
"list_attributes",
18+
"download_files",
2119
"fetch_experiments_table",
22-
"fetch_metrics",
2320
"fetch_metric_buckets",
21+
"fetch_metrics",
2422
"fetch_series",
25-
"download_files",
23+
"list_attributes",
24+
"list_experiments",
25+
"set_api_token",
26+
# Convenience exports (see the bottom of the file)
27+
"Attribute",
28+
"AttributeFilter",
29+
"Filter",
30+
"runs",
2631
]
2732

2833
import pathlib
@@ -499,3 +504,17 @@ def fetch_metric_buckets(
499504
include_point_previews=include_point_previews,
500505
container_type=_search.ContainerType.EXPERIMENT,
501506
)
507+
508+
509+
# PY-207 Convenience exports for things like:
510+
#
511+
# import neptune_query as nq
512+
# nq.runs.list_attributes(
513+
# runs=nq.Filter.eq(nq.Attribute("sys/name"), "my-run"),
514+
# attributes=nq.AttributeFilter(name="abc/"),
515+
# )
516+
#
517+
# Keep at the end of the file to avoid circular dependencies
518+
519+
from neptune_query import runs
520+
from neptune_query.filters import Attribute, AttributeFilter, Filter

0 commit comments

Comments
 (0)