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

Column name parsing fail for multiple-dot names #144

Open
3 tasks done
hombit opened this issue Sep 17, 2024 · 0 comments
Open
3 tasks done

Column name parsing fail for multiple-dot names #144

hombit opened this issue Sep 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hombit
Copy link
Collaborator

hombit commented Sep 17, 2024

Bug report

I have a column name "R.A." and lsdb.from_dataframe() fails

File /ocean/projects/phy210048p/malanche/lsdb-tests/cenv/lib/python3.11/site-packages/nested_pandas/nestedframe/core.py:58, in NestedFrame._is_known_hierarchical_column(self, colname)
     56 """Determine whether a string is a known hierarchical column name"""
     57 if "." in colname:
---> 58     left, right = colname.split(".")
     59     if left in self.nested_columns:
     60         return right in self.all_columns[left]

ValueError: too many values to unpack (expected 2)

We probably should count dots or unpack it safer, e.g. with left, right, *others = colname.split(".")

Before submitting
Please check the following:

  • I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants