Bug46381 - Add `storage_option` parameter to to_excel method in Styler
State: closed

- [x] closes #46381 
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: IO Excel
description: read_excel, to_excel
name: Styler
description: conditional formatting using DataFrame.style

Comments:
> this needs some sort of testing (even though its effectivevly passed thru).
> 
> see how we do this for read_csv and would need to do the same on specific types of storage backends.

@jreback 
What I found on tests folders is only `s3so` ,should I go with this storage option? and also where do I add the test in pandas/tests/io/excel/test_readers.py or test_style.py?

@jreback , or anyone , can help me figure my last question out , so we can publish this PR . thank you
The test should be added with the other styler tests. In pandas/tests/io/json there is `test_to_s3` which writes a json using storage_options. You can do a similar test for writing excel.
@jreback test added as well,
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
@eshirvana - are you interested in continuing here? I believe this is fairly close, just fixing the docs and a small improvement to the test.
> @rhshadrach 

i would love to , but I'm not sure how to fix the document part . any help is appreciated
@eshirvana - the easiest way I see to implement is in https://github.com/pandas-dev/pandas/pull/46491#discussion_r880982553. I think we should go ahead and do that to get the version added correct.
Thanks @eshirvana - the docstring change looks good. Some CI failures:

```
_____________________ ERROR at setup of test_styler_to_s3 ______________________
[gw1] linux -- Python 3.8.13 /usr/share/miniconda/envs/test/bin/python
file /home/runner/work/pandas/pandas/pandas/tests/io/excel/test_style.py, line 214
  def test_styler_to_s3(self, s3_resource, s3so):
E       fixture 'self' not found
```

Offhand it looks related but rerunning the jobs in case something was flakey. If they fail again, can you have a look.
@eshirvana - can you merge main; I think that will fix the CI issues.
@rhshadrach 
Not sure what's the issue. Would you please take look and let me know what's the issue and If I can fix it.
Thank you 
Thanks @eshirvana!

> @rhshadrach Not sure what's the issue. Would you please take look and let me know what's the issue and If I can fix it. Thank you

When there are CI failures in a PR, but recent PRs into main are green, it is likely the failure is unrelated and caused by an issue that has since been fixed. By merging in main into the PR as @jreback did, the CI runs again and we can double check this is the case.

We also like to merge main before merging a PR to run the tests again because it could be that there are other changes that have happened since the tests were last run that would identify issues.