BUG: to_json not allowing uploads to S3 (#28375)
- [x] closes #28375
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Hi, @jschendel! Thanks a lot for reviewing, I just made the changes you requested.

I was surprised to see the test suite fail as both `./ci/run_tests.py` and `pytest pandas/tests/io/json/test_pandas.py -k to_s3` were passing in my Docker container (which has no AWS credentials whatsoever). Any ideas on why? I may make further contributions in the future and I want to make sure that my dev env works properly.

Anyways, let's see if it works this time! > Any ideas on why? I may make further contributions in the future and I want to make sure that my dev env works properly.

Your environment is probably okay.  It looks like most failed due to  `ModuleNotFoundError: No module named 'boto3'`.  We don't have `boto3` as required package for non-dev environments, so it's not present on many of the CI builds (we test under various versions of python, packages, operating systems, locales, etc).  The `s3_resource` gracefully handles this among other things. @jschendel sounds good, thanks!

@jreback thanks for the feedback, I have just updated the PR accordingly. Lgtm outside code checks / @jschendel comments @jschendel thanks for the heads-up on the commit squashing, and apologies for the linter slip. I've updated the PR after making sure that the checks pass locally this time.

@WillAyd great, thank you! thanks @YagoGG  nice patch; very responsive. keep em coming. Is this issue fixed?