Skip to content

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Apr 10, 2015

Based on #809.

Allows subscribers of timestamping topics to sort messages.

@tseaver tseaver added the api: pubsub Issues related to the Pub/Sub API. label Apr 10, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 10, 2015
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling b0209de on tseaver:797-pubsub-add_sortable_message_timestamp into * on GoogleCloudPlatform:master*.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f4c51cf on tseaver:797-pubsub-add_sortable_message_timestamp into * on GoogleCloudPlatform:master*.

tseaver added 2 commits April 10, 2015 15:41
Allows subscribers of timestamping topics to sort messages.
- Ref. correct RFC.
- Private
- Add '_MICROS' to indicate which format from the sheaf allowed by the RFC.

Addresses points 1 and 2 from:
#816 (comment).

and:

#816 (comment)
@tseaver
Copy link
Contributor Author

tseaver commented Apr 10, 2015

Rebased after merge of #809.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ddb06db on tseaver:797-pubsub-add_sortable_message_timestamp into 028a15d on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor

dhermes commented Apr 10, 2015

Outside of the scope of this PR (just for my understand) what is an example of a naive timestamp being a bad idea? What problems occur?

Also note that isoformat does not produce timestamps that comply with our template

>>> import datetime
>>> import pytz
>>> now = datetime.datetime.utcnow().replace(tzinfo=pytz.UTC)
>>> now
datetime.datetime(2015, 4, 10, 21, 7, 20, 884712, tzinfo=<UTC>)
>>> now.isoformat()
'2015-04-10T21:07:20.884712+00:00'
>>> datetime.datetime(2015, 4, 10, 21, 7, 20, 0, tzinfo=pytz.UTC).isoformat()
'2015-04-10T21:07:20+00:00'
>>> datetime.datetime(2015, 4, 10, 21, 7, 20, 0).isoformat()
'2015-04-10T21:07:20'
>>> datetime.datetime(2015, 4, 10, 21, 7, 20, 100).isoformat()
'2015-04-10T21:07:20.000100'

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 04ced70 on tseaver:797-pubsub-add_sortable_message_timestamp into 028a15d on GoogleCloudPlatform:master.

@tseaver
Copy link
Contributor Author

tseaver commented Apr 16, 2015

@dhermes any remaining issues?

@dhermes
Copy link
Contributor

dhermes commented Apr 16, 2015

It looks like all my issues with the code were addressed.

Though I did ask you two questions in my last message. Do you mind answering?

LGTM

@tseaver
Copy link
Contributor Author

tseaver commented Apr 16, 2015

Naive datetimes are time-bombs: when created, their zone might be one of a) UTC, b) the "local" zone on the client's machine, or c) the "local" zone on the server. Later code has no way of knowing which zone was intended, making any use of such timestamps for ordering useless. Converting from a UTC timestamp string to a naive datetime discards the information.

#818 fixes the issues with using isoformat().

tseaver added a commit that referenced this pull request Apr 16, 2015
@tseaver tseaver merged commit 2c1e1ac into googleapis:master Apr 16, 2015
@tseaver tseaver deleted the 797-pubsub-add_sortable_message_timestamp branch April 16, 2015 20:13
@dhermes
Copy link
Contributor

dhermes commented Apr 16, 2015

Right, b) and c) are the scary parts. Thanks.

parthea pushed a commit that referenced this pull request Aug 21, 2025
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 16, 2025
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 18, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 22, 2025
* feat: add new v3.0.0 API skeleton (#745)

* feat: improve rows filters (#751)

* feat: read rows query model class (#752)

* feat: implement row and cell model classes (#753)

* feat: add pooled grpc transport (#748)

* feat: implement read_rows (#762)

* feat: implement mutate rows (#769)

* feat: literal value filter (#767)

* feat: row_exists and read_row (#778)

* feat: read_modify_write and check_and_mutate_row (#780)

* feat: sharded read rows (#766)

* feat: ping and warm with metadata (#810)

* feat: mutate rows batching (#770)

* chore: restructure module paths (#816)

* feat: improve timeout structure (#819)

* fix: api errors apply to all bulk mutations

* chore: reduce public api surface (#820)

* feat: improve error group tracebacks on < py11 (#825)

* feat: optimize read_rows (#852)

* chore: add user agent suffix (#842)

* feat: optimize retries (#854)

* feat: add test proxy (#836)

* chore(tests): add conformance tests to CI for v3 (#870)

* chore(tests): turn off fast fail for conformance tets (#882)

* feat: add TABLE_DEFAULTS enum for table method arguments (#880)

* fix: pass None for retry in gapic calls (#881)

* feat: replace internal dictionaries with protos in gapic calls (#875)

* chore: optimize gapic calls (#863)

* feat: expose retryable error codes to users (#879)

* chore: update api_core submodule (#897)

* chore: merge main into experimental_v3 (#900)

* chore: pin conformance tests to v0.0.2 (#903)

* fix: bulk mutation eventual success (#909)

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
* chore: Update gapic-generator-python to v1.13.0

PiperOrigin-RevId: 586460538

Source-Link: googleapis/googleapis@44582d0

Source-Link: googleapis/googleapis-gen@5e7073c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9

chore: Update gapic-generator-python to v1.12.0

PiperOrigin-RevId: 586356061

Source-Link: googleapis/googleapis@72a1f55

Source-Link: googleapis/googleapis-gen@558a04b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 25, 2025
* chore: Update gapic-generator-python to v1.13.0

PiperOrigin-RevId: 586460538

Source-Link: googleapis/googleapis@44582d0

Source-Link: googleapis/googleapis-gen@5e7073c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9

chore: Update gapic-generator-python to v1.12.0

PiperOrigin-RevId: 586356061

Source-Link: googleapis/googleapis@72a1f55

Source-Link: googleapis/googleapis-gen@558a04b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 26, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants