Skip to content

REF: define _header_line and have_mi_columns non-dynamically #53091

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

Merged
merged 1 commit into from
May 5, 2023

Conversation

jbrockmendel
Copy link
Member

Trying to make this code a little less stateful. Not having much luck. Pushing what I have before it falls off the radar.

def _header_line(self):
# Store line for reuse in _get_index_name
if self.header is not None:
return None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't ncols = len(self._header_line) fail if this is hit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming you're referring to L543, it would, but the "else" on L542 ensures that we dont get there with self.header not-None.

@mroeschke mroeschke added Refactor Internal refactoring of code IO CSV read_csv, to_csv labels May 5, 2023
@mroeschke mroeschke added this to the 2.1 milestone May 5, 2023
@mroeschke mroeschke merged commit 361260d into pandas-dev:main May 5, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-parsers branch May 5, 2023 21:04
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 7, 2023
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants