Skip to content

Inconsistent query table results with/without select columns #134

@bdpedigo

Description

@bdpedigo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions