Skip to content

GH-39702: [GLib] Add support for time zone in GArrowTimestampDataType#39717

Merged
kou merged 1 commit intoapache:mainfrom
kou:glib-timestamp-data-timezone
Jan 22, 2024
Merged

GH-39702: [GLib] Add support for time zone in GArrowTimestampDataType#39717
kou merged 1 commit intoapache:mainfrom
kou:glib-timestamp-data-timezone

Conversation

@kou
Copy link
Copy Markdown
Member

@kou kou commented Jan 20, 2024

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.

…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.
@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #39702 has been automatically assigned in GitHub to PR creator.

@kou
Copy link
Copy Markdown
Member Author

kou commented Jan 22, 2024

+1

@kou kou merged commit c33ffb0 into apache:main Jan 22, 2024
@kou kou deleted the glib-timestamp-data-timezone branch January 22, 2024 02:19
@kou kou removed the awaiting committer review Awaiting committer review label Jan 22, 2024
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit c33ffb0.

There was 1 benchmark result with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GLib] Allow to create time and timestamp arrays with a time zone

1 participant