Skip to content
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

feat(api core): simplify from_rfc3339 methods #8742

Closed
wants to merge 269 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
269 commits
Select commit Hold shift + click to select a range
ef86976
Update docstrings, change timeout and retry config (via synth). (#9197)
yoshi-automation Sep 10, 2019
ab07845
Make `threat_types` a required argument to `search_hashes` (via synth…
yoshi-automation Sep 10, 2019
9e1b896
Fix doc link (#9200)
WalterHub Sep 10, 2019
adfc6d3
BigQuery: Add support for array parameters to Cursor.execute() (#9189)
plamut Sep 10, 2019
e9f27b3
Fix tests b0rken by 'google-resumable-media 0.4.0' release. (#9204)
tseaver Sep 10, 2019
7da4a40
Add speaker diarization configuration support (via synth). (#9202)
tseaver Sep 10, 2019
f81bf63
Exclude noxfile from synth. (#9201)
tseaver Sep 11, 2019
82a8efb
Reorder samples manifest (via synth). (#9209)
yoshi-automation Sep 11, 2019
cd81f4e
Update samples manifest (via synth). (#9211)
yoshi-automation Sep 11, 2019
10eb892
BigQuery: Add client.insert_rows_from_dataframe() method (#9162)
plamut Sep 12, 2019
5b80023
Link to correct TimeoutError in futures docs (#9216)
plamut Sep 12, 2019
1a2311a
Revert "Disable failing snippets test (#9156)" (#9220)
tswast Sep 12, 2019
69ff0bf
BigQuery: Change the default value of Cursor instances' arraysize att…
plamut Sep 12, 2019
88becff
Add more product categories (via synth). (#9224)
yoshi-automation Sep 13, 2019
a616b85
Add `filter_` arg to `ProfileServiceClient.list_profiles`; docstring …
yoshi-automation Sep 13, 2019
3473719
Add 'Model.encryption_config' (via synth). (#9214)
tseaver Sep 13, 2019
c21ec23
Change default endpoint to bigquery.googleapis.com (#9213)
busunkim96 Sep 13, 2019
ef3cc4a
Allow recursive group deletion, deprecate internal checkers, add SSL…
yoshi-automation Sep 13, 2019
7572488
Revert manual change to enum docstring references (via synth). (#9180)
yoshi-automation Sep 13, 2019
795bb32
Add support for 'STORAGE_EMULATOR_HOST' env var; add 'benchwrapper' s…
jeanbza Sep 16, 2019
99e2769
Add 'applications' / 'assignments' fields to 'Profile' message (via s…
yoshi-automation Sep 16, 2019
2c2e717
Add RPC annotations, update docstrings (via synth). (#9230)
yoshi-automation Sep 16, 2019
b32ba26
Preserve GcsClient, 'pandas' extras in testing (via synth). (#9179)
yoshi-automation Sep 16, 2019
53d6925
Avoid using 'REGIONAL' / 'MULTI_REGIONAL' in examples, tests. (#9205)
tseaver Sep 16, 2019
409a425
Release bigquery 1.20.0 (#9227)
busunkim96 Sep 16, 2019
b4ea85c
Revert " Allow recursive group deletion, deprecate internal checkers,…
busunkim96 Sep 17, 2019
f129701
Storage: Revert #9204: "Fix tests b0rken by 'google-resumable-media 0…
tseaver Sep 18, 2019
fe18948
Update README example to use non-deprecated 'query.get'. (#9235)
tseaver Sep 18, 2019
6988dd1
Retry bucket creation on 503 responses. (#9248)
tseaver Sep 18, 2019
f890d29
Storage: Move benchwrapper directory into 'tests/perf/'. (#9246)
tseaver Sep 18, 2019
51f97e8
Add 'COLLECTION_GROUP' to 'Index.QueryScope' enum; update docstrings …
yoshi-automation Sep 19, 2019
bd1cf0e
BigQuery: Restrict version range of google-resumable-media. (#9243)
crwilcox Sep 19, 2019
598d9bd
` Talent: Deprecate `candidate_availability_filter` for `availability…
yoshi-automation Sep 20, 2019
9023477
DLP: Add vpcsc tests (#9249)
maximus12793 Sep 20, 2019
ee0f70a
BigQuery: Add ability to pass in a table ID instead of a query to the…
shubha-rajan Sep 23, 2019
e993961
Logging: Add LoggingV2Servicer, LogSinks, logging_metrics, and log_en…
yoshi-automation Sep 23, 2019
4540b23
docs: Fix `run_in_transaction` return value docs. (#9264)
wchargin Sep 23, 2019
10a824b
test(videointelligence): enrich VPCSC tests (#9193)
mkudejim Sep 23, 2019
7cc01b8
test(dlp): ensure GOOGLE_CLOUD_TESTS_IN_VPCSC is down cast for env va…
maximus12793 Sep 24, 2019
c8485c7
docs(core): fix Google Auth Credentials help link now (#9260)
sukeesh Sep 24, 2019
31e96ae
config(pubsub): adjust messaging RPC timeout settings (via synth)
yoshi-automation Sep 24, 2019
5f0bc11
Make 'session_count' optional for 'SpannerClient.batch_create_session…
yoshi-automation Sep 24, 2019
4182805
Update client config (via sync). (#9265)
yoshi-automation Sep 24, 2019
700ce51
docs: fix intersphinx reference to requests (#9294)
busunkim96 Sep 25, 2019
e3a0c27
chore(dlp): exclude 'noxfile.py' from synth (#9284)
tseaver Sep 25, 2019
cdd59c1
docs(firestore): remove duplicated word in README (#9297)
PaulTR Sep 25, 2019
bfb957c
docs(speech): update docstrings (via synth) (#9292)
yoshi-automation Sep 25, 2019
66e1b74
feat(automl): add 'image_classification_model_deployment_metadata' ar…
yoshi-automation Sep 25, 2019
8762283
cleanup(storage): fix typo in '_helpers.py' (#9239)
jingtaow Sep 25, 2019
d8ce06e
Storage: HMAC add user_project param (#9237)
jkwlui Sep 25, 2019
7c9c0cb
feat(bigquery): add support for custom QueryJobConfig in BigQuery.cur…
Sep 26, 2019
ced30b4
chore(storage): release google-cloud-storage-1.20.0 (#9319)
tseaver Sep 26, 2019
b3ac67e
codegen(language): reorder samples (#9310)
yoshi-automation Sep 26, 2019
3cd6eb6
codegen(logging): add deprecated 'start_time' / 'end_time' fields to …
yoshi-automation Sep 26, 2019
19ff6a6
codegen(speech): reorder samples (#9313)
yoshi-automation Sep 26, 2019
f6e185f
docs(bigquery): document how to load data as JSON string (#9231)
plamut Sep 26, 2019
c037a51
style(bigquery): add code samples to lint check (#9277)
plamut Sep 26, 2019
6e6cd39
feat(bigquery): store QueryJob to destination var on error (#9245)
plamut Sep 26, 2019
21cf56e
docs(bigquery): standardize comments and formatting in existing code …
emar-kar Sep 26, 2019
2bb22ae
fix(pubsub): set default stream ACK deadline to subscriptions' (#9268)
plamut Sep 27, 2019
c91eb11
feat(bigquery): add support for listing jobs by parent job (#9225)
plamut Sep 27, 2019
4a4574e
chore(bigquery_datatransfer): add field annotations (via synth) (#9328)
yoshi-automation Sep 27, 2019
a1b083e
chore(spanner): adjust gRPC timeouts (via synth) (#9330)
yoshi-automation Sep 27, 2019
04112c1
chore(pubsub): release PubSub 1.0.1 (#9331)
pradn Sep 27, 2019
cb5170b
chore(bigquery_storage): fix up protobuf messages w/o summary docstri…
tseaver Sep 27, 2019
20ebf60
docs(storage): clarify docstring for 'Blob.download_as_string' (#9332)
tseaver Sep 27, 2019
d07fb46
feat(recommender): generate v1beta1 (#9257)
busunkim96 Sep 27, 2019
9fa39fa
chore(recommender): release 0.1.0 (#9336)
busunkim96 Sep 27, 2019
8b60456
feat(error_reporting): add client_options to constructor (#9152)
busunkim96 Sep 30, 2019
1026350
chore(logging): release logging 1.13.0 (#9269)
busunkim96 Sep 30, 2019
7cd36a5
fix(pubsub): streaming pull shouldn't need subscriptions.get permissi…
plamut Sep 30, 2019
a876842
feat(translate): make 'parent' argument required for all client metho…
yoshi-automation Sep 30, 2019
0c4f55b
chore(automl): release 0.6.0 (#9361)
busunkim96 Sep 30, 2019
1851ccf
test(speech): add v1 systests for longrunning / streaming recognize (…
wangbill-google Sep 30, 2019
57734a3
test(speech): add v1p1beta1 systests for longrunning / streaming reco…
wangbill-google Sep 30, 2019
df5e3e9
chore(pubsub): release 1.0.2 (#9362)
plamut Sep 30, 2019
63b70d4
fix(tasks): add proto annotations (via synth) (#9352)
yoshi-automation Sep 30, 2019
bbd09fd
fix(pubsub): add 'StreamingPullManager._should_terminate' (#9335)
tseaver Oct 1, 2019
7b5b006
docs(phishingprotection): update docstrings (via synth) (#9350)
yoshi-automation Oct 1, 2019
1826e49
enhancement(language): add entity types (via synth) (#9373)
yoshi-automation Oct 1, 2019
abd022f
feat(websecurityscanner): add finding types; add vulnerable headers; …
yoshi-automation Oct 1, 2019
619bcc9
enhancement(automl): add support for passing project to 'GcsClient' …
mcollins42 Oct 1, 2019
07e83bc
chore: add pradn to Pub/Sub codeowners (#9383)
busunkim96 Oct 1, 2019
e4b9800
chore(translate): update 'ListGlossaries' method annotation (via synt…
yoshi-automation Oct 2, 2019
645822f
docs: refresh list of libraries and CONTRIBUTING.rst (#9387)
busunkim96 Oct 2, 2019
f068eb8
fix(api_core): finalize during close of 'ResumableBidiRpc' (#9337)
tseaver Oct 2, 2019
0518ddf
docs(recommender): fix library reference doc link (#9338)
busunkim96 Oct 4, 2019
7924508
tests(error_reporting): increase 'max_tries'. (#9396)
tseaver Oct 4, 2019
12a7f30
feat(translate): generate v3 (#9020)
busunkim96 Oct 4, 2019
2fef1e6
feat(automl): generate v1 (#9388)
busunkim96 Oct 4, 2019
740dab5
docs(webrisk): change requests intersphinx ref (via synth) (#9414)
yoshi-automation Oct 7, 2019
df47af0
docs(vision): update docstring for `product_category`, change request…
yoshi-automation Oct 7, 2019
45ba999
docs(videointellignece): change requests intersphinx url (via synth) …
yoshi-automation Oct 7, 2019
b5852fa
docs(videointellignece): change requests intersphinx url (via synth) …
yoshi-automation Oct 7, 2019
4b375c5
docs(tasks): change requests intersphinx url (via synth) (#9409)
yoshi-automation Oct 7, 2019
fe476fe
docs(recommender): change requests intersphinx url (via synth) (#9408)
yoshi-automation Oct 7, 2019
61ef87b
docs(phishingprotection): change requests intersphinx url (via synth)…
yoshi-automation Oct 7, 2019
3284e23
docs(containeranalysis): change requests intersphinx ref (via synth)
yoshi-automation Oct 7, 2019
060e8c5
docs(dlp): change requests intersphinx ref (via synth) (#9403)
yoshi-automation Oct 7, 2019
be13817
docs(iam): change requests intersphinx ref (via synth) (#9404)
yoshi-automation Oct 7, 2019
f9ac561
docs(iot): change requests intersphinx ref (via synth) (#9405)
yoshi-automation Oct 7, 2019
818365b
docs(irm): change requests intersphinx ref (via synth) (#9406)
yoshi-automation Oct 7, 2019
b7206f6
chore(translate): update docstrings, client confg (via synth) (#9411)
yoshi-automation Oct 7, 2019
9ea608d
chore(automl): lint protos, update requests intersphinx URL (via synt…
yoshi-automation Oct 7, 2019
edfc3f6
feat(dataproc): add V1 autoscaling policy support; annotate protos (…
yoshi-automation Oct 7, 2019
f5fb682
chore(automl): release 0.7.0 (#9399)
busunkim96 Oct 7, 2019
3b612b1
chore(api_core): release 1.14.3 (#9417)
crwilcox Oct 7, 2019
c43da0b
enhancment(automl): return operation future from `AutoMlClient.create…
yoshi-automation Oct 8, 2019
6253458
chore(talent): release 0.4.0 (#9397)
busunkim96 Oct 8, 2019
2906381
chore: add common pull request template (#9422)
busunkim96 Oct 8, 2019
8e409a0
docs(tasks): disambiguate client requests from cloud task requests (#…
busunkim96 Oct 8, 2019
59d967e
codegen(videointelligence)!: drop support for `V1beta1` version of th…
tseaver Oct 8, 2019
cf27795
feat(bigquery): add support for sheets ranges (#9416)
emar-kar Oct 8, 2019
0ae0d8b
fix(redis): update client config (via synth) (#9424)
yoshi-automation Oct 9, 2019
dc1f780
chore(talent): tweak docstrings (via synth) (#9432)
yoshi-automation Oct 9, 2019
470af83
chore(tasks): tweak docstrings (via synth) (#9433)
yoshi-automation Oct 9, 2019
81ded40
chore(videointelligence): tweak docstrings, client configuration (via…
yoshi-automation Oct 9, 2019
8540625
docs(webrisk): tweak docstrings (via synth) (#9435)
yoshi-automation Oct 9, 2019
40cbb0c
docs(automl): fix assorted typos/bugs in docstrings (#9415)
lwander Oct 9, 2019
cd77a41
chore: remove top-level docs directory (#9430)
busunkim96 Oct 9, 2019
52f200a
chore(translate): release 1.7.0 (#9421)
busunkim96 Oct 9, 2019
4280306
tests(texttospeech): create system tests for V1 / V1beta1 (#9418)
wangbill-google Oct 9, 2019
4517e4d
chore(automl): release 0.7.0 (#9427)
busunkim96 Oct 9, 2019
6f1d68f
test(translation): add VPC-SC system tests (#9272)
Oct 9, 2019
baf5a52
fix(websecurityscanner): add `FORBIDDEN_UPDATE_TO_MANAGED_SCAN` erro…
yoshi-automation Oct 10, 2019
ba02ecd
fix(vision): add proto annotations (via synth) (#9441)
yoshi-automation Oct 10, 2019
848694f
feat(firestore): add `IN`, `ARRAY_CONTAINS_ANY` operators; update doc…
yoshi-automation Oct 10, 2019
1ea60a4
fix(logging): fix proto copy (#9420)
busunkim96 Oct 10, 2019
896aef4
chore(datalabeling): release 0.3.0 (#9443)
tseaver Oct 10, 2019
bc7ef55
chore(resource_manager): release 0.30.0 (#9448)
tseaver Oct 10, 2019
a4ccd0b
chore(grafeas): release 0.3.0 (#9446)
tseaver Oct 10, 2019
32412ba
chore(phishingprotection): release 0.2.0 (#9447)
tseaver Oct 10, 2019
1d4a547
feat(bigquery): add script statistics to job resource (#9428)
tswast Oct 10, 2019
dc5215c
refactor(bigquery): rewrite docs in Google style, part 1 (#9326)
Oct 10, 2019
42ce2ef
fix(storage): enable CSEK w/ V4 signed URLs (#9450)
tseaver Oct 10, 2019
22c0782
fix(phishingprotection): use correct release status (#9451)
tseaver Oct 10, 2019
66cdc58
docs(bigquery): fix incorrect links to REST API in reference docs (#9…
Oct 11, 2019
37166af
fix(storage): call anonumous client method to remove dependency of go…
HemangChothani Oct 11, 2019
8a7eb38
test(bigquery): simplify scripting system test to reduce flakiness (#…
tswast Oct 14, 2019
7743e30
docs(scheduler): change docstring formatting, add API proto annotatio…
yoshi-automation Oct 14, 2019
65f02a7
docs: remove references to the old authentication credentials (#9456)
emar-kar Oct 14, 2019
01f6826
refactor(bigquery): update code samples to use strings for table and …
emar-kar Oct 15, 2019
431e169
chore(dataproc): tweak proto annotations (via synth) (#9466)
yoshi-automation Oct 15, 2019
3e51514
chore(phishingprotection): release 0.2.0 (#9452)
tseaver Oct 15, 2019
8c3df6e
chore: pin 'google-cloud-core >= 1.0.3, < 2.0.0dev' (#9445)
tseaver Oct 15, 2019
99862d2
chore(datastore): release 1.10.0 (#9449)
tseaver Oct 15, 2019
9ddae10
chore(bigtable): release 1.1.0 (#9468)
tseaver Oct 15, 2019
60e9598
chore(firestore): release 1.5.0 (#9470)
tseaver Oct 15, 2019
acf122d
chore(logging): release 1.14.0 (#9471)
tseaver Oct 15, 2019
36d811a
chore(runtimeconfig): release 0.30.0 (#9472)
tseaver Oct 15, 2019
29f82e9
chore(spanner): release 1.11.0 (#9473)
tseaver Oct 15, 2019
fa2c798
chore(trace): release 0.23.0 (#9474)
tseaver Oct 15, 2019
0771add
chore(dns): release 0.31.0 (#9469)
tseaver Oct 15, 2019
a79d98d
feat(storage): support predefined ACLs in 'Bucket.create' (#9334)
tseaver Oct 15, 2019
2fdd6e6
feat(bigquery): add Dataset.default_partition_expiration_ms and Table…
tswast Oct 15, 2019
af96c3e
test(dlp): ensure env is always set; fix typo in test_deidentify_cont…
maximus12793 Oct 16, 2019
1dd4731
feat(bigquery): expose customer managed encryption key for ML models …
HemangChothani Oct 16, 2019
02f2dc2
chore(error_reporting): pin 'google-cloud-logging >= 1.14.0, < 2.0.0d…
tseaver Oct 16, 2019
32eda79
chore(bigquery): release 1.21.0 (#9484)
tswast Oct 17, 2019
ecb2162
feat(bigquery): add range partitioning to tables, load jobs, and quer…
tswast Oct 18, 2019
8c3b652
feat(bigquery): implement defaultEncryptionConfiguration on datasets …
HemangChothani Oct 18, 2019
9872fb0
chore(datacatalog): add codeowners for data catalog (#9508)
tswast Oct 21, 2019
fbc10b8
feat(spanner): add client_options to constructor (#9151)
busunkim96 Oct 22, 2019
62c4f5a
test(spanner): propagate errors from 'Transaction.batch_update' (#9393)
tseaver Oct 22, 2019
b93be69
tests(spanner): harden 'test_transaction_batch_update_w_syntax_error'…
tseaver Oct 22, 2019
a5b21a6
tests(spanner): harden 'test_reload_instance' against EC (#9394)
tseaver Oct 22, 2019
91a929f
chore(error_reporting): release 0.33.0 (#9515)
tseaver Oct 22, 2019
c6ecf19
feat(trace): add `client_options` to constructor (#9154)
busunkim96 Oct 22, 2019
98639f8
feat(dns): add 'client_options' argument to client ctor (#9516)
tseaver Oct 22, 2019
4644da1
fix(bigquery): fix arrow deprecation warning (#9504)
plamut Oct 22, 2019
55a920e
feat(spanner): add batch_create_session calls to session pools (#9488)
larkee Oct 23, 2019
4098386
feat(bigquery): add TypeError if wrong job_config type is passed to c…
HemangChothani Oct 23, 2019
cfb493f
feat(datacatalog): add entry group operations (#9520)
yoshi-automation Oct 23, 2019
29ab89c
docs(datastore): remove duplication of word 'API' (#9524)
s3bw Oct 23, 2019
d66e1d7
chore(datacatalog): release 0.4.0 (#9526)
tswast Oct 23, 2019
bde08e9
feat(translate)!: make v3 the default client (#9498)
busunkim96 Oct 23, 2019
8c92a20
refactor(bigquery): use multi-regional key path for CMEK in snippets …
Oct 23, 2019
8d598de
docs(storage): add hmac_key and notification documentation rst files …
frankyn Oct 24, 2019
1f532f6
chore(bigquery): remove duplicate test dependencies (#9503)
plamut Oct 24, 2019
160cef6
chore(translate): release 2.0.0 (#9527)
busunkim96 Oct 24, 2019
7e175c6
chore(spanner): release 1.12.0 (#9530)
larkee Oct 24, 2019
2beaa95
feat(bigtable): add 'client_options' / 'admin_client_options' to Clie…
tseaver Oct 24, 2019
35ba046
tests(monitoring): refresh VPCSC tests (#9437)
steinwaywhw Oct 24, 2019
14e140c
feat(oslogin)!: rename `fingerprint_path` to `ssh_public_key_path`; r…
yoshi-automation Oct 25, 2019
764251d
fix(storage): update storage endpoint from www.googleapis.com to stor…
crwilcox Oct 25, 2019
73a07d4
refactor(bigquery): rewrite docs in Google style, part 2 (#9481)
Oct 26, 2019
8e7e89c
doc(bigquery): add code sample for scripting (#9537)
tswast Oct 28, 2019
9e5ca9a
fix(automl): pass credentials to underlying clients in TableClient (#…
shunghsiyu Oct 28, 2019
604f32d
fix: don't report a gapic version for storage (#9549)
crwilcox Oct 28, 2019
9fd07ec
fix(videointelligence): make `features` a positional parameter in `an…
yoshi-automation Oct 28, 2019
de3abdf
fix(scheduler)!: remove `project_path` method, update docstrings (via…
yoshi-automation Oct 28, 2019
025867a
fix: add gcloud-python header to user agent (#9551)
crwilcox Oct 29, 2019
3614e5f
chore(storage): release 1.21.0 (#9553)
crwilcox Oct 29, 2019
bc45d76
chore(webrisk): add trailing commas (via synth) (#9563)
yoshi-automation Oct 29, 2019
202bb9a
chore(trace): add trailing commas (via synth) (#9562)
yoshi-automation Oct 29, 2019
9f1c680
chore(securitycenter): add trailing commas (via synth) (#9561)
yoshi-automation Oct 29, 2019
42525f8
chore(grafeas): add trailing commas (via synth) (#9558)
yoshi-automation Oct 29, 2019
17330db
chore(logging): add trailing commas (via synth) (#9560)
yoshi-automation Oct 29, 2019
2e9e132
chore(bigquery): format code with latest version of black (#9556)
yoshi-automation Oct 29, 2019
dfc8a80
feat(asset): add `bigquery_destination` to `OutputConfig`; make cont…
yoshi-automation Oct 29, 2019
b2f28ca
chore(bigtable): add trailing commas (via synth) (#9557)
yoshi-automation Oct 29, 2019
ee62142
docs(spanner): update description of the timeout_secs parameter (#9381)
emar-kar Oct 29, 2019
847cd43
docs(translation): fix v2 imports, remove v2 sample in README (#9536)
busunkim96 Oct 29, 2019
e41c140
feat(talent): add `query_language_code` to `talent.v4beta1.JobQuery` …
yoshi-automation Oct 30, 2019
abdfa3f
feat(firestore): surface new 'IN' and 'ARRAY_CONTAINS_ANY' operators …
tseaver Oct 30, 2019
22df5b5
chore(asset): release 0.5.0 (#9567)
busunkim96 Oct 30, 2019
e0e4d1a
chore(automl): release 0.7.1 (#9566)
busunkim96 Oct 30, 2019
412a17b
fix(speech): move 'speaker_tag' field from 'SpeakerDiarizationConfig'…
yoshi-automation Oct 31, 2019
cdcc278
feat(storage): add UBLA attrs to IAMConfiguration (#9475)
tseaver Oct 31, 2019
df185b9
chore(pubsub): add subscriber role test for streaming (#9507)
plamut Oct 31, 2019
21e9457
feat(api_core): provide a 'raw_page' field for page_iterator.Page (#9…
software-dov Nov 1, 2019
48359eb
test(spanner): harden 'test_transaction_batch_update*' systests again…
tseaver Nov 1, 2019
3e8fbae
docs(bigquery): document how to achieve higher write limit and add te…
plamut Nov 1, 2019
5571911
feat(datacatalog): add sample to create an entry group (#9584)
ricardolsmendes Nov 1, 2019
89eaedb
feat(bigquery): allow passing schema as a sequence of dicts (#9550)
plamut Nov 3, 2019
518931b
feat(tasks): add HTTP tasks, OAuth tokens, and OIDC tokens (via synth…
yoshi-automation Nov 4, 2019
ed37540
fix(bigquery): use pyarrow fallback for improved schema detection (#9…
plamut Nov 4, 2019
f72ab40
feat(datacatalog): add sample to create a fileset entry (#9590)
ricardolsmendes Nov 5, 2019
4dc94d7
chore(storage): release 1.22.0 (#9604)
tseaver Nov 5, 2019
4af68dc
chore(tasks): release 1.3.0 (#9595)
busunkim96 Nov 5, 2019
5f716db
feat(storage): add opt-in raw download support (#9572)
tseaver Nov 5, 2019
41ae858
tests: add centralized VPCSC config detection (#9581)
tseaver Nov 5, 2019
9405db9
feat(bigquery): add `--destination_table` parameter to IPython magic …
vlasenkoalexey Nov 6, 2019
c4a69d4
doc(bigquery): add table create sample using integer range partitioni…
tswast Nov 6, 2019
9831c1d
feat(videointelligence): add celebrity recognition support (via synth…
yoshi-automation Nov 6, 2019
605cb42
feat(vision): add celebrity recognition support; add object annotatio…
yoshi-automation Nov 6, 2019
7a3a74d
fix(monitoring): make VPCSC env comparison case-insensitive (#9564)
steinwaywhw Nov 6, 2019
ba3668d
fix(containeranalysis): make google.cloud.devtools a namespace (#9606)
busunkim96 Nov 6, 2019
e6ddd3b
tests(automl): normalize VPCSC configuration in systests (#9607)
tseaver Nov 7, 2019
c996af0
tests(storage): normalize VPCSC configuration in systests (#9616)
tseaver Nov 7, 2019
f1136a7
docs(firestore): clarify client threadsafety (#9254)
HemangChothani Nov 7, 2019
879d9a1
docs(firestore): add documentation for Document,Collection .on_snapsh…
HemangChothani Nov 7, 2019
1e7c0a6
feat(pubsub): add stop method (#9365)
Nov 7, 2019
79bdd03
chore(firestore): release 1.6.0 (#9621)
crwilcox Nov 7, 2019
097a22f
tests: fix typos in new 'vpcsc_config' module (#9630)
tseaver Nov 7, 2019
8c83b52
feat(cloudbuild): generate v1 (#9510)
busunkim96 Nov 7, 2019
5621e9c
fix(firestore): simplify 'Collection.add', avoid spurious API call (#…
tseaver Nov 7, 2019
5ac8440
chore(containeranalysis): release 0.3.1 (#9636)
busunkim96 Nov 7, 2019
c8b8165
chore(cloudbuild): release 0.1.0 (#9635)
busunkim96 Nov 7, 2019
5137c03
feat(documentai): initial generation of documentai (#9623)
busunkim96 Nov 7, 2019
873a60d
API Core: simplify methods
emar-kar Jul 22, 2019
796204c
Update test_datetime_helpers.py
emar-kar Jul 24, 2019
0503e92
Update datetime_helpers.py
emar-kar Jul 25, 2019
dc4f896
Update datetime_helpers.py
emar-kar Jul 26, 2019
4bcf651
Update test_datetime_helpers.py
emar-kar Jul 26, 2019
8151cae
Update datetime_helpers.py
emar-kar Jul 26, 2019
447ed3e
Update datetime_helpers.py
emar-kar Aug 23, 2019
1fc8661
update datetime_helpers
emar-kar Sep 5, 2019
93f8883
Merge branch 'Methods-Combining' of https://github.com/q-logic/google…
emar-kar Nov 8, 2019
9dcffee
update comments
emar-kar Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 39 additions & 25 deletions api_core/google/api_core/datetime_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import calendar
import datetime
import re
import warnings

import pytz

Expand Down Expand Up @@ -115,20 +116,8 @@ def from_iso8601_time(value):


def from_rfc3339(value):
"""Convert a microsecond-precision timestamp to datetime.

Args:
value (str): The RFC3339 string to convert.

Returns:
datetime.datetime: The datetime object equivalent to the timestamp in
UTC.
"""
return datetime.datetime.strptime(value, _RFC3339_MICROS).replace(tzinfo=pytz.utc)


def from_rfc3339_nanos(value):
crwilcox marked this conversation as resolved.
Show resolved Hide resolved
"""Convert a nanosecond-precision timestamp to a native datetime.
"""Convert a nanosecond-precision or if nanoseconds are missing
microsecond-precision timestamp to a native datetime.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary line should be more terse: e.g.:

    """Convert an RFC3339-format timestamp to a native datetime.

    Supported formats include those without fractional seconds, or with
    any fraction up to nanosecond precision.

    .. note::


.. note::
Python datetimes do not support nanosecond precision; this function
Expand All @@ -138,12 +127,9 @@ def from_rfc3339_nanos(value):
value (str): The RFC3339 string to convert.

Returns:
datetime.datetime: The datetime object equivalent to the timestamp in
UTC.
datetime.datetime: The datetime object equivalent to the timestamp
in UTC.

Raises:
ValueError: If the timestamp does not match the RFC 3339
regular expression.
"""
with_nanos = _RFC3339_NANOS.match(value)

emar-kar marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -169,6 +155,34 @@ def from_rfc3339_nanos(value):
return bare_seconds.replace(microsecond=micros, tzinfo=pytz.utc)


def from_rfc3339_nanos(value):
"""DEPRECATED. Convert a nanosecond-precision timestamp to a native datetime.
crwilcox marked this conversation as resolved.
Show resolved Hide resolved

.. note::
Python datetimes do not support nanosecond precision; this
function therefore truncates such values to microseconds.

Args:
value (str): The RFC3339 string to convert.

Returns:
datetime.datetime: The datetime object equivalent to the
timestamp in UTC.

Raises:
ValueError: If the timestamp does not match the RFC3339
regular expression.
"""
# Raise deprecation warnings for things we want to go away.
warnings.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this warning then I am good

"The `from_rfc3339_nanos` function is deprecated"
" use `from_rfc3339` instead.",
DeprecationWarning,
stacklevel=2,
)
emar-kar marked this conversation as resolved.
Show resolved Hide resolved
return from_rfc3339(value)


def to_rfc3339(value, ignore_zone=True):
"""Convert a datetime to an RFC3339 timestamp string.

Expand Down Expand Up @@ -215,22 +229,22 @@ def nanosecond(self):
return self._nanosecond

def rfc3339(self):
"""Return an RFC 3339-compliant timestamp.
"""Return an RFC3339-compliant timestamp.

Returns:
(str): Timestamp string according to RFC 3339 spec.
(str): Timestamp string according to RFC3339 spec.
"""
if self._nanosecond == 0:
return to_rfc3339(self)
nanos = str(self._nanosecond).rjust(9, '0').rstrip("0")
nanos = str(self._nanosecond).rjust(9, "0").rstrip("0")
return "{}.{}Z".format(self.strftime(_RFC3339_NO_FRACTION), nanos)

@classmethod
def from_rfc3339(cls, stamp):
"""Parse RFC 3339-compliant timestamp, preserving nanoseconds.
"""Parse RFC3339-compliant timestamp, preserving nanoseconds.

Args:
stamp (str): RFC 3339 stamp, with up to nanosecond precision
stamp (str): RFC3339 stamp, with up to nanosecond precision

Returns:
:class:`DatetimeWithNanoseconds`:
Expand Down Expand Up @@ -280,7 +294,7 @@ def timestamp_pb(self):

@classmethod
def from_timestamp_pb(cls, stamp):
"""Parse RFC 3339-compliant timestamp, preserving nanoseconds.
"""Parse RFC3339-compliant timestamp, preserving nanoseconds.

Args:
stamp (:class:`~google.protobuf.timestamp_pb2.Timestamp`): timestamp message
Expand Down
96 changes: 72 additions & 24 deletions api_core/tests/unit/test_datetime_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import calendar
import datetime

import mock
import pytest
import pytz

Expand All @@ -23,6 +24,9 @@


ONE_MINUTE_IN_MICROSECONDS = 60 * 1e6
MESSAGE = (
"The `from_rfc3339_nanos` function is deprecated" " use `from_rfc3339` instead."
)


def test_utcnow():
Expand Down Expand Up @@ -82,18 +86,18 @@ def test_from_rfc3339():
)


def test_from_rfc3339_with_bad_tz():
value = "2009-12-17T12:44:32.123456BAD"

with pytest.raises(ValueError):
datetime_helpers.from_rfc3339(value)

def test_from_rfc3339_nanos():
value = "2009-12-17T12:44:32.123456Z"
assert datetime_helpers.from_rfc3339_nanos(value) == datetime.datetime(
2009, 12, 17, 12, 44, 32, 123456, pytz.utc
)

def test_from_rfc3339_with_nanos():
value = "2009-12-17T12:44:32.123456789Z"

with pytest.raises(ValueError):
datetime_helpers.from_rfc3339(value)
def test_from_rfc3339_without_nanos():
value = "2009-12-17T12:44:32Z"
assert datetime_helpers.from_rfc3339(value) == datetime.datetime(
2009, 12, 17, 12, 44, 32, 0, pytz.utc
)


def test_from_rfc3339_nanos_without_nanos():
Expand All @@ -103,11 +107,37 @@ def test_from_rfc3339_nanos_without_nanos():
)


def test_from_rfc3339_nanos_with_bad_tz():
value = "2009-12-17T12:44:32.123456789BAD"
@pytest.mark.parametrize(
"truncated, micros",
[
("12345678", 123456),
("1234567", 123456),
("123456", 123456),
("12345", 123450),
("1234", 123400),
("123", 123000),
("12", 120000),
("1", 100000),
],
)
def test_from_rfc3339_with_truncated_nanos(truncated, micros):
value = "2009-12-17T12:44:32.{}Z".format(truncated)
assert datetime_helpers.from_rfc3339(value) == datetime.datetime(
2009, 12, 17, 12, 44, 32, micros, pytz.utc
)
emar-kar marked this conversation as resolved.
Show resolved Hide resolved

with pytest.raises(ValueError):
datetime_helpers.from_rfc3339_nanos(value)

def test_from_rfc3339_nanos_is_deprecated():
from_rfc3339_patch = mock.patch("google.api_core.datetime_helpers.from_rfc3339")
warnings_patch = mock.patch("warnings.warn")
value = "2009-12-17T12:44:32.123456Z"

with from_rfc3339_patch as from_rfc3339, warnings_patch as warn:
result = datetime_helpers.from_rfc3339_nanos(value)

assert result is from_rfc3339.return_value
from_rfc3339.assert_called_once_with(value)
warn.assert_called_once_with(MESSAGE, DeprecationWarning, stacklevel=2)


@pytest.mark.parametrize(
Expand All @@ -130,6 +160,18 @@ def test_from_rfc3339_nanos_with_truncated_nanos(truncated, micros):
)


def test_from_rfc3339_wo_nanos_raise_exception():
value = "2009-12-17T12:44:32"
with pytest.raises(ValueError):
datetime_helpers.from_rfc3339(value)


def test_from_rfc3339_w_nanos_raise_exception():
value = "2009-12-17T12:44:32.123456"
with pytest.raises(ValueError):
datetime_helpers.from_rfc3339(value)


def test_to_rfc3339():
value = datetime.datetime(2016, 4, 5, 13, 30, 0)
expected = "2016-04-05T13:30:00.000000Z"
Expand Down Expand Up @@ -157,10 +199,11 @@ def test_to_rfc3339_with_non_utc_ignore_zone():


class Test_DateTimeWithNanos(object):

@staticmethod
def test_ctor_wo_nanos():
stamp = datetime_helpers.DatetimeWithNanoseconds(2016, 12, 20, 21, 13, 47, 123456)
stamp = datetime_helpers.DatetimeWithNanoseconds(
2016, 12, 20, 21, 13, 47, 123456
)
assert stamp.year == 2016
assert stamp.month == 12
assert stamp.day == 20
Expand Down Expand Up @@ -200,7 +243,9 @@ def test_ctor_w_micros_keyword_and_nanos():

@staticmethod
def test_rfc3339_wo_nanos():
stamp = datetime_helpers.DatetimeWithNanoseconds(2016, 12, 20, 21, 13, 47, 123456)
stamp = datetime_helpers.DatetimeWithNanoseconds(
2016, 12, 20, 21, 13, 47, 123456
)
assert stamp.rfc3339() == "2016-12-20T21:13:47.123456Z"

@staticmethod
Expand Down Expand Up @@ -285,12 +330,16 @@ def test_from_rfc3339_w_full_precision():
)
def test_from_rfc3339_test_nanoseconds(fractional, nanos):
value = "2009-12-17T12:44:32.{}Z".format(fractional)
assert datetime_helpers.DatetimeWithNanoseconds.from_rfc3339(value).nanosecond == nanos
assert (
datetime_helpers.DatetimeWithNanoseconds.from_rfc3339(value).nanosecond
== nanos
)

@staticmethod
def test_timestamp_pb_wo_nanos_naive():
stamp = datetime_helpers.DatetimeWithNanoseconds(
2016, 12, 20, 21, 13, 47, 123456)
2016, 12, 20, 21, 13, 47, 123456
)
delta = stamp.replace(tzinfo=pytz.UTC) - datetime_helpers._UTC_EPOCH
seconds = int(delta.total_seconds())
nanos = 123456000
Expand All @@ -304,7 +353,8 @@ def test_timestamp_pb_w_nanos():
)
delta = stamp - datetime_helpers._UTC_EPOCH
timestamp = timestamp_pb2.Timestamp(
seconds=int(delta.total_seconds()), nanos=123456789)
seconds=int(delta.total_seconds()), nanos=123456789
)
assert stamp.timestamp_pb() == timestamp

@staticmethod
Expand All @@ -314,8 +364,7 @@ def test_from_timestamp_pb_wo_nanos():
seconds = int(delta.total_seconds())
timestamp = timestamp_pb2.Timestamp(seconds=seconds)

stamp = datetime_helpers.DatetimeWithNanoseconds.from_timestamp_pb(
timestamp)
stamp = datetime_helpers.DatetimeWithNanoseconds.from_timestamp_pb(timestamp)

assert _to_seconds(when) == _to_seconds(stamp)
assert stamp.microsecond == 0
Expand All @@ -329,8 +378,7 @@ def test_from_timestamp_pb_w_nanos():
seconds = int(delta.total_seconds())
timestamp = timestamp_pb2.Timestamp(seconds=seconds, nanos=123456789)

stamp = datetime_helpers.DatetimeWithNanoseconds.from_timestamp_pb(
timestamp)
stamp = datetime_helpers.DatetimeWithNanoseconds.from_timestamp_pb(timestamp)

assert _to_seconds(when) == _to_seconds(stamp)
assert stamp.microsecond == 123456
Expand Down