-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GLib] Allow to create time and timestamp arrays with a time zone #39702
Comments
Timezone support for |
I see. While I'm not an expert on time issues, but Time Zone could affect Date{32|64}; is it? |
Time zone doesn't affect Time zone doesn't change the number of days. |
…taType Timestamp data type in Apache Arrow supports time zone but Apache Arrow C GLib didn't support it. Timestamp data type has "timezone-aware" mode and "timezone-naive" mode. If a timestamp data type has a valid time zone information, it uses "timezone-aware" mode. If a timestamp data type doesn't have a valid time zone information, it uses "timezone-naive" mode. Apache Arrow C GLib should support both of them. This change adds a new `GTimeZone *time_zone` argument to `garrow_timestamp_data_type_new()` instead of adding a new `garrow_timestamp_data_type_new_time_zone()` function. This breaks backward compatibility for Apache Arrow C GLib users. But this still keeps backward compatibility for users of bindings such as Ruby and Vala. Because the new `GTimeZone *time_zone` is nullable. I tried to use the "adding a new `garrow_timestamp_data_type_new_time_zone()` function" approach but Vala didn't like it. Both of `garrow_timestamp_data_type_new_time_zone()` (constructor) and `garrow_timestamp_data_type_get_time_zone()` (instance method or property reader) were mapped to `GArrow.TimestampDataType.time_zone()`. So I chose the "adding a new argument to `garrow_timestamp_data_type_new()`" approach.
…#39717) ### Rationale for this change Timestamp data type in Apache Arrow supports time zone but Apache Arrow C GLib didn't support it. Timestamp data type has "timezone-aware" mode and "timezone-naive" mode. If a timestamp data type has a valid time zone information, it uses "timezone-aware" mode. If a timestamp data type doesn't have a valid time zone information, it uses "timezone-naive" mode. Apache Arrow C GLib should support both of them. ### What changes are included in this PR? This change adds a new `GTimeZone *time_zone` argument to `garrow_timestamp_data_type_new()` instead of adding a new `garrow_timestamp_data_type_new_time_zone()` function. This breaks backward compatibility for Apache Arrow C GLib users. But this still keeps backward compatibility for users of bindings such as Ruby and Vala. Because the new `GTimeZone *time_zone` is nullable. I tried to use the "adding a new `garrow_timestamp_data_type_new_time_zone()` function" approach but Vala didn't like it. Both of `garrow_timestamp_data_type_new_time_zone()` (constructor) and `garrow_timestamp_data_type_get_time_zone()` (instance method or property reader) were mapped to `GArrow.TimestampDataType.time_zone()`. So I chose the "adding a new argument to `garrow_timestamp_data_type_new()`" approach. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * Closes: #39702 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…taType (apache#39717) ### Rationale for this change Timestamp data type in Apache Arrow supports time zone but Apache Arrow C GLib didn't support it. Timestamp data type has "timezone-aware" mode and "timezone-naive" mode. If a timestamp data type has a valid time zone information, it uses "timezone-aware" mode. If a timestamp data type doesn't have a valid time zone information, it uses "timezone-naive" mode. Apache Arrow C GLib should support both of them. ### What changes are included in this PR? This change adds a new `GTimeZone *time_zone` argument to `garrow_timestamp_data_type_new()` instead of adding a new `garrow_timestamp_data_type_new_time_zone()` function. This breaks backward compatibility for Apache Arrow C GLib users. But this still keeps backward compatibility for users of bindings such as Ruby and Vala. Because the new `GTimeZone *time_zone` is nullable. I tried to use the "adding a new `garrow_timestamp_data_type_new_time_zone()` function" approach but Vala didn't like it. Both of `garrow_timestamp_data_type_new_time_zone()` (constructor) and `garrow_timestamp_data_type_get_time_zone()` (instance method or property reader) were mapped to `GArrow.TimestampDataType.time_zone()`. So I chose the "adding a new argument to `garrow_timestamp_data_type_new()`" approach. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * Closes: apache#39702 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…taType (apache#39717) ### Rationale for this change Timestamp data type in Apache Arrow supports time zone but Apache Arrow C GLib didn't support it. Timestamp data type has "timezone-aware" mode and "timezone-naive" mode. If a timestamp data type has a valid time zone information, it uses "timezone-aware" mode. If a timestamp data type doesn't have a valid time zone information, it uses "timezone-naive" mode. Apache Arrow C GLib should support both of them. ### What changes are included in this PR? This change adds a new `GTimeZone *time_zone` argument to `garrow_timestamp_data_type_new()` instead of adding a new `garrow_timestamp_data_type_new_time_zone()` function. This breaks backward compatibility for Apache Arrow C GLib users. But this still keeps backward compatibility for users of bindings such as Ruby and Vala. Because the new `GTimeZone *time_zone` is nullable. I tried to use the "adding a new `garrow_timestamp_data_type_new_time_zone()` function" approach but Vala didn't like it. Both of `garrow_timestamp_data_type_new_time_zone()` (constructor) and `garrow_timestamp_data_type_get_time_zone()` (instance method or property reader) were mapped to `GArrow.TimestampDataType.time_zone()`. So I chose the "adding a new argument to `garrow_timestamp_data_type_new()`" approach. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * Closes: apache#39702 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…taType (apache#39717) ### Rationale for this change Timestamp data type in Apache Arrow supports time zone but Apache Arrow C GLib didn't support it. Timestamp data type has "timezone-aware" mode and "timezone-naive" mode. If a timestamp data type has a valid time zone information, it uses "timezone-aware" mode. If a timestamp data type doesn't have a valid time zone information, it uses "timezone-naive" mode. Apache Arrow C GLib should support both of them. ### What changes are included in this PR? This change adds a new `GTimeZone *time_zone` argument to `garrow_timestamp_data_type_new()` instead of adding a new `garrow_timestamp_data_type_new_time_zone()` function. This breaks backward compatibility for Apache Arrow C GLib users. But this still keeps backward compatibility for users of bindings such as Ruby and Vala. Because the new `GTimeZone *time_zone` is nullable. I tried to use the "adding a new `garrow_timestamp_data_type_new_time_zone()` function" approach but Vala didn't like it. Both of `garrow_timestamp_data_type_new_time_zone()` (constructor) and `garrow_timestamp_data_type_get_time_zone()` (instance method or property reader) were mapped to `GArrow.TimestampDataType.time_zone()`. So I chose the "adding a new argument to `garrow_timestamp_data_type_new()`" approach. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * Closes: apache#39702 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the enhancement requested
Current API to create a
GArrowTimestamp
, requires aGArrowTimestampDataType
.An
GArrowTimestampDataType
can be created but only is possible to define its time units; there isn't an API to create one adding a time zone as in PyArrow.So a new garrow_timestamp_data_type_new_with_timezone() method is required using the following signature:
This should help GLib users to create timestamps with a time zone.
Above will require to add a method to get the current
GTimeZone
:Above API should be the added too, to
GArrowTime32Array
andGArrowTime64Array
arrays, so is easy to know the time zone the time is representing.Component(s)
GLib
The text was updated successfully, but these errors were encountered: