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

Inconsistent query table results with/without select columns #134

Open
bdpedigo opened this issue Mar 19, 2024 · 0 comments
Open

Inconsistent query table results with/without select columns #134

bdpedigo opened this issue Mar 19, 2024 · 0 comments

Comments

@bdpedigo
Copy link

bdpedigo commented Mar 19, 2024

I am getting inconsistent results in a CAVEclient query to materialization engine when I do/do not use the select columns feature

MRE:

import caveclient as cc
import numpy as np
import pandas as pd

client = cc.CAVEclient("minnie65_phase3_v1")

timestamp = pd.to_datetime("2021-07-01 00:00:00", utc=True)

soma_ids = [
    292864,
    291116,
    303149,
    264824,
    292670,
    260541,
    301085,
    294825,
    292649,
    298937,
    262678,
]

old_roots = client.materialize.query_table(
    "nucleus_detection_v0",
    filter_in_dict={"id": soma_ids},
    timestamp=timestamp,
).set_index("id")["pt_root_id"]
print(old_roots)

old_roots_w_select = client.materialize.query_table(
    "nucleus_detection_v0",
    filter_in_dict={"id": soma_ids},
    select_columns=["id", "pt_root_id"],
    timestamp=timestamp,
).set_index("id")["pt_root_id"]
print(old_roots_w_select)

Output

id
291116    864691135526260315
262678    864691136602049489
292864    864691135941381492
298937    864691135771983611
292670    864691135568038892
294825    864691135618041743
292649    864691135394228469
260541    864691136109120184
301085    864691135776863584
264824    864691136423000111
303149    864691135132830624
Name: pt_root_id, dtype: int64
id
291116    864691135373964873
262678    864691135323006620
292864    864691135497601299
298937    864691135587354052
292670    864691135303414951
294825    864691135815624783
292649    864691136965924814
260541    864691135777415357
301085    864691135941379188
264824    864691135100010784
303149    864691136031932603
Name: pt_root_id, dtype: int64

Note that these are not the same. Based on some other testing, old_roots is the correct answer.

@bdpedigo bdpedigo changed the title Inconsistent query table results with/without select Inconsistent query table results with/without select columns Mar 19, 2024
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

No branches or pull requests

1 participant