Migrate from Fetcher Alpha to Query API
To update your code from neptune_fetcher.alpha to neptune_query:
-
Instead of
neptune-fetcher, install:pip install "neptune-query>=1.2.0,<2.0.0" -
Change the import statements to the following:
import neptune_query as nq
import neptune_query.runs as nq_runs
from neptune_query.filters import Filter, Attribute, AttributeFilter -
To override the Neptune project or API token set by environment variables, use the following instead of the
Contextclass:- To set the API token for the session, call
nq.set_api_token("SomeNeptuneApiToken"). - To set the project, pass the project path to the
projectargument of any fetching method.
- To set the API token for the session, call
-
The
aggregationargument ofAttributeandAttributeFilteris removed. Change your script to no longer use this parameter. -
Because the extended syntax is supported for regular expressions, some filter options have been streamlined.
-
The following
Filtermethods have been replaced:matches_all(),matches_none()→matches()name_in(),name_eq→name()
-
The following
AttributeFilterparameters have been replaced:name_eq,name_in,name_matches_all,name_matches_none→nametype_in→type
-
-
The
Filter.any()andFilter.all()methods are removed. To join filters, use the operators|and&instead.