You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using LAPIS data (data_source: "lapis"), the rule filter exits with the error: ValueError: cannot reindex on an axis with duplicate labels1. I think augur is unhappy that a year column already exists in the LAPIS data.
Additional Context
I'm using a conda environment rather than the docker image. But the conda environment works flawlessly for Nextstrain data, just not LAPIS. I'm guessing it's because I'm using a newer version of pandas (v1.4.2) since augur is also raising FutureWarning: reindexing with a non-unique Index is deprecated.
Possible Solution
One way to solve this, would be to drop the year column before the filter rule. Adding the following segment to scripts/wrangle_metadata.py fixes the issue for me:
# Remove the year column, because it will break augur filterif"year"inmetadata.columns:
new_dates= []
# Iterate through the 'date' and 'year' columnsfors_date, s_yearinzip(metadata["date"], metadata["year"]):
# If date is null, we use the yearifpd.isna(s_date) andnotpd.isna(s_year):
new_dates.append("{}-XX-XX".format(int(s_year)))
# if date is not null, use itelifnotpd.isna(s_date):
new_dates.append(s_date)
# Otherwise, use noneelse:
new_dates.append(None)
metadata["date"] =new_datesmetadata.drop(columns=["year"], inplace=True)
Steps to Reproduce
Here is the shell command in isolation (after LAPIS download):
Context
When using LAPIS data (
data_source: "lapis"
), the rulefilter
exits with the error:ValueError: cannot reindex on an axis with duplicate labels1
. I thinkaugur
is unhappy that ayear
column already exists in the LAPIS data.Additional Context
I'm using a conda environment rather than the docker image. But the conda environment works flawlessly for Nextstrain data, just not LAPIS. I'm guessing it's because I'm using a newer version of
pandas
(v1.4.2) sinceaugur
is also raisingFutureWarning: reindexing with a non-unique Index is deprecated
.Possible Solution
One way to solve this, would be to drop the
year
column before thefilter
rule. Adding the following segment toscripts/wrangle_metadata.py
fixes the issue for me:Steps to Reproduce
Here is the shell command in isolation (after LAPIS download):
Environment
Full Traceback
The text was updated successfully, but these errors were encountered: