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

fixes issues with lineage graph filtering with client side filtering #125

Merged
merged 15 commits into from
Oct 16, 2023

Conversation

fcollman
Copy link
Collaborator

This is necessary on v1 at least where timestamp filtering does not appear to give the result one would want.

root_ts = client.chunkedgraph.get_root_timestamps(root_id)[0]
mat_timestamp=client.materialize.get_version_metadata(version=630)['time_stamp']
lineage_graph= client.chunkedgraph.get_lineage_graph(root_id, timestamp_past=root_ts,
                                                     timestamp_future=mat_timestamp)
print(f'root_ts: {root_ts} mat_timestamp: {mat_timestamp}')
for node in lineage_graph['nodes']:
    node_ts= datetime.datetime.fromtimestamp(node['timestamp'])
    node_ts=node_ts.astimezone(datetime.timezone.utc)
    if ( (node_ts<mat_timestamp) or (node_ts>root_ts)):
        print(node, node_ts)

@fcollman fcollman requested a review from sdorkenw October 10, 2023 17:34
@fcollman fcollman force-pushed the improve_get_latest_roots branch from 48d6cf1 to 8e440b1 Compare October 13, 2023 16:20
Copy link

@arie-matsliah arie-matsliah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

isinstance(root_id, int)
or isinstance(root_id, np.uint64)
or isinstance(root_id, np.int64)
):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:
if isinstance(root_id, (int, np.uint64, np.int64))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

timestamp_past=None,
timestamp_future=None,
as_nx_graph=False,
exclude_links_to_future=False,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these be timestamps or None? then we could use 2 args instead of 4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this is slightly different, it depends on whether you want to include links that cross over the boundary or not. For different use cases you might want those or not. For example, when going backward in time, you might want to know the first root_id that comes before the timestamp_past, because that is the root_id that would be current at timestamp_past.

@fcollman fcollman merged commit b14fd2b into master Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants