Skip to content

Conversation

@antznette1
Copy link

@antznette1 antznette1 commented Oct 30, 2025

@rhshadrach

@antznette1
Copy link
Author

Hi @rhshadrach, I hope you’re doing well.
When you get a chance, could you please review my PR? I’d really appreciate your feedback so we can move it forward.
Thanks a lot!

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I think this is looking good. Unfortunately it seems that odfpy does not provide a reasonable way to add an autofilter. If that is the case, I think we should raise when autofilter=True is passed and this engine is used. Can you add this and a test.

Can you also add tests for:

  • nonzero startrow / startcol
  • A DataFrame with MultiIndex columns (also called a hierarchical index) with both merge_cells=True and merge_cells=False.

@antznette1
Copy link
Author

Thanks for the PR! I think this is looking good. Unfortunately it seems that odfpy does not provide a reasonable way to add an autofilter. If that is the case, I think we should raise when autofilter=True is passed and this engine is used. Can you add this and a test.

Can you also add tests for:

  • nonzero startrow / startcol
  • A DataFrame with MultiIndex columns (also called a hierarchical index) with both merge_cells=True and merge_cells=False.

Okay, Im working on them now

@antznette1
Copy link
Author

Hi @rhshadrach .
Could you please review my PR when you are chanced?

@rhshadrach
Copy link
Member

@antznette1 - tests are failing, are you able to run them locally?

Also I want to mention #62994 is looking to add the same feature and appears close to being ready.

@antznette1
Copy link
Author

@antznette1 - tests are failing, are you able to run them locally?

Also I want to mention #62994 is looking to add the same feature and appears close to being ready.

Yes, I can run locally. I realized my branch currently adds tests that assert behavior for an API not on main yet (and I left some debug prints). I’m cleaning that up now.

@antznette1 antznette1 changed the title ENH: Add autofilter parameter to DataFrame.to_excel TST: Add xfail tests for Excel header autofilter (openpyxl/xlsxwriter) Nov 7, 2025
@antznette1
Copy link
Author

antznette1 commented Nov 7, 2025

Thanks for the heads-up. I’ve trimmed this PR to tests-only and marked the new autofilter tests xfail until #62994 lands. No engine/docs changes remain here. Once #62994 merges, I’ll flip these to pass and expand coverage as needed.

@rhshadrach
Copy link
Member

@antznette1 - each merge of main kicks off a full CI run. This is not necessary to do multiple times a day; once a week is sufficient.

@antznette1
Copy link
Author

@antznette1 - each merge of main kicks off a full CI run. This is not necessary to do multiple times a day; once a week is sufficient.

Thanks for the heads-up. I’ll avoid frequent merges of main and will update at most weekly or when necessary (conflicts or upstream-related CI failures). I’ll also prefer rebasing to keep history clean. This PR remains tests-only and xfail until #62994 lands.

@antznette1
Copy link
Author

@rhshadrach
Good day, Hope you are well?

I want to ask about the #62994 progress so I can convert from xfail

@rhshadrach
Copy link
Member

@antznette1 - #62994 has been merged; I'm not sure if the tests here expand our coverage or are duplicative of the tests there. Can you take a look.

@antznette1
Copy link
Author

antznette1 commented Nov 20, 2025

@antznette1 - #62994 has been merged; I'm not sure if the tests here expand our coverage or are duplicative of the tests there. Can you take a look.

I removed the duplicates so that the tests are in engine-specific files, which helps with:

  • Engine-specific debugging
  • Clearer organization
  • More detailed assertions per engine

These tests expand coverage by adding edge cases not covered in PR #62994.

@rhshadrach
Copy link
Member

I removed the duplicates so that the tests are in engine-specific files, which helps with:
...

I think we should prefer parametrized tests. This then will automatically apply to engines that are to be added in the future, and makes removing engines easier as well. In particular, I do not think we should have tests in test_writers.py and tests in each of the enigne-specific test files that have the same coverage.

@antznette1
Copy link
Author

I removed the duplicates so that the tests are in engine-specific files, which helps with:
...

I think we should prefer parametrized tests. This then will automatically apply to engines that are to be added in the future, and makes removing engines easier as well. In particular, I do not think we should have tests in test_writers.py and tests in each of the enigne-specific test files that have the same coverage.

Thanks for the suggestion.

I’ve rebased this branch on main so it now includes the parametrized autofilter tests in TestExcelWriter in test_writers.py. To avoid duplicated coverage:

  • I kept the engine-specific files (test_openpyxl.py, test_xlsxwriter.py) free of any autofilter tests.
  • I moved the additional autofilter edge cases I had (empty DataFrame, single row, single column, header=False) into TestExcelWriter as parametrized tests over engine.
    This way, all shared autofilter behavior is tested once, in the parametrized suite, and any future engines will automatically get this coverage.

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

Successfully merging this pull request may close these issues.

2 participants