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

Closed
3 tasks done
hombit opened this issue Sep 17, 2024 · 1 comment · Fixed by #177
Closed
3 tasks done

Column name parsing fail for multiple-dot names #144

hombit opened this issue Sep 17, 2024 · 1 comment · Fixed by #177
Assignees
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.
@hombit hombit added the bug Something isn't working label Sep 17, 2024
@dougbrn dougbrn self-assigned this Sep 26, 2024
@dougbrn dougbrn removed their assignment Oct 15, 2024
@gitosaurus gitosaurus self-assigned this Nov 18, 2024
@gitosaurus gitosaurus linked a pull request Nov 23, 2024 that will close this issue
10 tasks
@gitosaurus
Copy link
Contributor

Note that this particular bug appears to have been fixed by @dougbrn in commit 1cde0c1. #177 changed the method, and didn't regress.

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

Successfully merging a pull request may close this issue.

3 participants