From 016b063f4f95c0604d9572be5e2f7a68b437a4c7 Mon Sep 17 00:00:00 2001 From: Hazem Elmeleegy Date: Wed, 16 Oct 2024 17:08:41 -0700 Subject: [PATCH] SNOW-1737253: Update docs for tz_convert/tz_localize variants to specify supported timezone formats (#2453) 1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR. Fixes SNOW-1737253 2. Fill out the following pre-review checklist: - [ ] I am adding a new automated test(s) to verify correctness of my new code - [ ] If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency - [ ] If this is a new feature/behavior, I'm adding the Local Testing parity changes. - [ ] I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: [Thread-safe Developer Guidelines](https://docs.google.com/document/d/162d_i4zZ2AfcGRXojj0jByt8EUq-DrSHPPnTa4QvwbA/edit#bookmark=id.e82u4nekq80k) 3. Please describe how your code solves the related issue. Update docs for tz_convert/tz_localize variants to specify supported timezone formats. --- CHANGELOG.md | 1 + .../modin/supported/dataframe_supported.rst | 15 +++++++++++---- .../modin/supported/datetime_index_supported.rst | 14 +++++++++++--- .../modin/supported/series_dt_supported.rst | 11 +++++++++++ docs/source/modin/supported/series_supported.rst | 15 +++++++++++---- 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 113617e20d..2e3facc41f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Improved generated SQL query for `head` and `iloc` when the row key is a slice. - Improved error message when passing an unknown timezone to `tz_convert` and `tz_localize` in `Series`, `DataFrame`, `Series.dt`, and `DatetimeIndex`. +- Improved documentation for `tz_convert` and `tz_localize` in `Series`, `DataFrame`, `Series.dt`, and `DatetimeIndex` to specify the supported timezone formats. #### Bug Fixes diff --git a/docs/source/modin/supported/dataframe_supported.rst b/docs/source/modin/supported/dataframe_supported.rst index fede65e1c3..5689aec7d3 100644 --- a/docs/source/modin/supported/dataframe_supported.rst +++ b/docs/source/modin/supported/dataframe_supported.rst @@ -481,10 +481,17 @@ Methods +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``truncate`` | N | | | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_convert`` | P | ``axis``, ``level``, ``copy`` | | -+-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_localize`` | P | ``axis``, ``level``, ``copy``, | | -| | | ``ambiguous``, ``nonexistent`` | | +| ``tz_convert`` | P | ``axis``, ``level``, ``copy`` | ``N`` if timezone format is not supported. | +| | | | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as ``UTC+09:00``, is not | +| | | | supported. | ++-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ +| ``tz_localize`` | P | ``axis``, ``level``, ``copy`` | ``N`` if timezone format is not supported. | +| | | ``ambiguous``, ``nonexistent`` | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as ``UTC+09:00``, is not | +| | | | supported. | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``unstack`` | P | ``sort`` | ``N`` for non-integer ``level``. | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ diff --git a/docs/source/modin/supported/datetime_index_supported.rst b/docs/source/modin/supported/datetime_index_supported.rst index 9ebf6935f7..3453b422b0 100644 --- a/docs/source/modin/supported/datetime_index_supported.rst +++ b/docs/source/modin/supported/datetime_index_supported.rst @@ -82,9 +82,17 @@ Methods +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``snap`` | N | | | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_convert`` | Y | | | -+-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_localize`` | P | ``ambiguous``, ``nonexistent`` | | +| ``tz_convert`` | P | | ``N`` if timezone format is not supported. | +| | | | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as, ``UTC+09:00`` is not | +| | | | supported. | ++-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ +| ``tz_localize`` | P | ``ambiguous``, ``nonexistent`` | ``N`` if timezone format is not supported. | +| | | | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as, ``UTC+09:00`` is not | +| | | | supported. | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``round`` | P | ``ambiguous``, ``nonexistent`` | | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ diff --git a/docs/source/modin/supported/series_dt_supported.rst b/docs/source/modin/supported/series_dt_supported.rst index 68853871ea..f3d969fe23 100644 --- a/docs/source/modin/supported/series_dt_supported.rst +++ b/docs/source/modin/supported/series_dt_supported.rst @@ -80,8 +80,19 @@ the method in the left column. +-----------------------------+---------------------------------+----------------------------------------------------+ | ``to_pydatetime`` | N | | +-----------------------------+---------------------------------+----------------------------------------------------+ +| ``tz_convert`` | P | ``N`` if timezone format is not supported. | +| | | Only timezones listed in ``pytz.all_timezones`` are| +| | | supported. For example, ``UTC`` is supported but | +| | | ``UTC+/-``, such as ``UTC+09:00``, is not | +| | | supported. | ++-----------------------------+---------------------------------+----------------------------------------------------+ | ``tz_localize`` | P | ``N`` if `ambiguous` or `nonexistent` are set to a | | | | non-default value. | +| | | ``N`` if timezone format is not supported. | +| | | Only timezones listed in ``pytz.all_timezones`` are| +| | | supported. For example, ``UTC`` is supported but | +| | | ``UTC+/-``, such as ``UTC+09:00``, is not | +| | | supported. | +-----------------------------+---------------------------------+----------------------------------------------------+ | ``tz_convert`` | Y | | +-----------------------------+---------------------------------+----------------------------------------------------+ diff --git a/docs/source/modin/supported/series_supported.rst b/docs/source/modin/supported/series_supported.rst index 03026f03c9..b74bd40432 100644 --- a/docs/source/modin/supported/series_supported.rst +++ b/docs/source/modin/supported/series_supported.rst @@ -457,10 +457,17 @@ Methods +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``truncate`` | N | | | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_convert`` | P | ``axis``, ``level``, ``copy`` | | -+-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ -| ``tz_localize`` | P | ``axis``, ``level``, ``copy``, | | -| | | ``ambiguous``, ``nonexistent`` | | +| ``tz_convert`` | P | ``axis``, ``level``, ``copy`` | ``N`` if timezone format is not supported. | +| | | | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as, ``UTC+09:00`` is not | +| | | | supported. | ++-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ +| ``tz_localize`` | P | ``axis``, ``level``, ``copy`` | ``N`` if timezone format is not supported. | +| | | ``ambiguous``, ``nonexistent`` | Only timezones listed in ``pytz.all_timezones`` are| +| | | | supported. For example, ``UTC`` is supported but | +| | | | ``UTC+/-``, such as ``UTC+09:00``, is not | +| | | | supported. | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+ | ``unique`` | Y | | | +-----------------------------+---------------------------------+----------------------------------+----------------------------------------------------+