BUG: to_datetime with xarray DataArray and specifie unit errors
- [x] closes #44053
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

Converted values of xarray.DataArray to numpy.ndarray to solve the problem.
Hello @shubham11941140! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`pandas/tests/tools/test_to_datetime.py`](https://github.com/pandas-dev/pandas/blob/155563fcc3efe4e8fe9db4649d3f127caf9206fd/pandas/tests/tools/test_to_datetime.py):

> [Line 2656:5](https://github.com/pandas-dev/pandas/blob/155563fcc3efe4e8fe9db4649d3f127caf9206fd/pandas/tests/tools/test_to_datetime.py#L2656): [E265](https://duckduckgo.com/?q=pep8%20E265) block comment should start with '# '
> [Line 2661:16](https://github.com/pandas-dev/pandas/blob/155563fcc3efe4e8fe9db4649d3f127caf9206fd/pandas/tests/tools/test_to_datetime.py#L2661): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 2662:16](https://github.com/pandas-dev/pandas/blob/155563fcc3efe4e8fe9db4649d3f127caf9206fd/pandas/tests/tools/test_to_datetime.py#L2662): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent
> [Line 2663:15](https://github.com/pandas-dev/pandas/blob/155563fcc3efe4e8fe9db4649d3f127caf9206fd/pandas/tests/tools/test_to_datetime.py#L2663): [E128](https://duckduckgo.com/?q=pep8%20E128) continuation line under-indented for visual indent



##### Comment last updated at 2021-10-17 19:46:06 UTC closing in favor of https://github.com/pandas-dev/pandas/pull/44074