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

Error in drying to drop column that doesn't exist. #40

Open
erinyoung opened this issue Aug 9, 2024 · 1 comment
Open

Error in drying to drop column that doesn't exist. #40

erinyoung opened this issue Aug 9, 2024 · 1 comment

Comments

@erinyoung
Copy link
Collaborator

HeatCluster is throwing an error:

/workspace/heatcluster/heatcluster.py:55: PerformanceWarning: Determining the column names of a LazyFrame requires resolving its schema, which is a potentially expensive operation. Use `LazyFrame.collect_schema().names()` to get the column names without this warning.
  if len(tabs.columns) > len(commas.columns):
Traceback (most recent call last):
  File "/workspace/heatcluster/heatcluster.py", line 163, in <module>
    main(args)
  File "/workspace/heatcluster/heatcluster.py", line 42, in main
    df = clean_and_read_df(df)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/heatcluster/heatcluster.py", line 65, in clean_and_read_df
    df = df.drop("0")
         ^^^^^^^^^^^^
  File "/workspace/.pyenv_mirror/user/current/lib/python3.12/site-packages/polars/dataframe/frame.py", line 7278, in drop
    return self.lazy().drop(*columns, strict=strict).collect(_eager=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/.pyenv_mirror/user/current/lib/python3.12/site-packages/polars/lazyframe/frame.py", line 2027, in collect
    return wrap_df(ldf.collect(callback))
                   ^^^^^^^^^^^^^^^^^^^^^
polars.exceptions.ColumnNotFoundError: "0" not found

The SNP matrix can be found in this issue:

UPHL-BioNGS/Grandeur#221

@DrB-S
Copy link
Owner

DrB-S commented Aug 9, 2024

Where would I insert 'LazyFrame.collect_schema().names()' as suggested in the error above? And would I remove 'df = df.drop("0")'?

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

2 participants