Closed jefferis closed 1 day ago
Python example:
>>> import caveclient
>>> import pandas as pd
>>> import datetime
>>> datastack_name = "flywire_fafb_public"
>>> client = caveclient.CAVEclient(datastack_name)
>>> postsyn_df = client.materialize.live_query("synapses_nt_v1", filter_in_dict={"post_pt_root_id": [720575940617343316]}, timestamp=datetime.datetime.now())
/Users/jefferis/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.10/site-packages/caveclient/materializationengine.py:1085: ChainedAssignmentError: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
When using the Copy-on-Write mode, such inplace method never works to update the original DataFrame or Series, because the intermediate object on which we are setting values always behaves as a copy.
For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' instead, to perform the operation inplace on the original object.
df[root_id_col].replace(future_map, inplace=True)
R example
library(fafbseg)
flywire_partner_summary('720575940617343316', method = 'cave')
thanks for this greg.. on our radar now. we should proactively pin pandas<3.0 for now till we get this warning taking care of.
Thanks @fcollman! I'm getting this with 2.2.2 so I think the pin would have to be a bit more aggressive than <3.0 and might cause trouble elsewhere. I guess the warnings are designed to be annoying enough to make people bite the bullet and fix!
this is just a warning though right at 2.2.2 ?
I've pinned it below 3.0 for now
It's just a warning at 2.2.2 but it's a very noisy one!
fixed in ed0b1aecf3a2083be1b8bc6a97bd9c97ab42b4ee (in addition to the pin)
I'm seeing this (a lot) with my new caveclient install.
https://github.com/CAVEconnectome/CAVEclient/blame/863eeb21879729c8ebc5e4c64ce742e6906733e4/caveclient/materializationengine.py#L1085
pandas is at version 2.2.2 and this is a summary of the rest of my Python env.