-
Notifications
You must be signed in to change notification settings - Fork 58
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: add generated sync client #1017
Merged
Merged
Changes from 250 commits
Commits
Show all changes
422 commits
Select commit
Hold shift + click to select a range
d17a98c
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche fd1fb71
fixed decorator sync_impl call
daniel-sanche c0b4185
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche adb092e
use add_mapping in place of replace_symbols
daniel-sanche 45efa16
support automatic attribute registration
daniel-sanche e1ec974
reduced replace_symbols usage in tests
daniel-sanche 021fde2
fixed lint issues
daniel-sanche 58405d1
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche de0fd90
added missing imports
daniel-sanche 6ca3ddd
get mappings working for sync implementation
daniel-sanche b2cf937
moved decorators into new file
daniel-sanche 4860061
moved transformation from transformers into decorators
daniel-sanche 63891d7
simplified arguments for decorators
daniel-sanche 164f5a8
use separate decorate method
daniel-sanche 8317973
comments and clean up
daniel-sanche f9dd41d
ran blacken
daniel-sanche 22b093f
moved ast decorators into new file
daniel-sanche 5ebf889
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche 8d13c5e
ran blacken
daniel-sanche ea8072f
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche 769cac1
changed sync impl name
daniel-sanche f87b832
fixed mapping function
daniel-sanche f2b6d08
convert to async with pytest mark
daniel-sanche 754adf8
Merge branch 'cross_sync_pr1_replacements' into cross_sync_pr2_genera…
daniel-sanche 3ed5935
convert changes async to sync def by default
daniel-sanche d0ba7b0
added rm_aio for stripping asyncio keywords
daniel-sanche 37b4833
reverted client and test changes
daniel-sanche af020a2
Revert "reverted client and test changes"
daniel-sanche 698902d
added sync pooled transport
daniel-sanche 64166db
only strip CrossSync.rm_aio on Call visits
daniel-sanche 73ba23b
support decorators in nested functions
daniel-sanche 12e8860
added missing convert annotations
daniel-sanche 63a528a
added import blocks for sync versions
daniel-sanche f5dcdf5
added annotations to tests
daniel-sanche be40771
removed unneeded test imports
daniel-sanche a676d49
ran blacken
daniel-sanche c63d88e
fixed lint issues
daniel-sanche 5d11fc0
added generated files
daniel-sanche 3bb6c6f
added files to __init__.py
daniel-sanche 4a041c8
added cross_sync to path for transformers
daniel-sanche cbc36dd
support table in helpers
daniel-sanche 03b60ed
removed quoted cross sync classes
daniel-sanche 3762a03
fixed mypy issues
daniel-sanche 274bd36
moved cross_sync into own directory
daniel-sanche 5611614
added docstrings
daniel-sanche ad95748
added README
daniel-sanche cad416d
fixed README formatting
daniel-sanche 9b92e65
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 18292a4
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 9a19658
added rm_aio to pytest and convert decorators
daniel-sanche a378c45
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 02b2268
Merge branch 'main' into cross_sync2_pr1_architecture
daniel-sanche f3643f1
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche dc54f7a
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche b64c0c7
create paths when writing sync outputs
daniel-sanche 223f337
moved files
daniel-sanche 51d2358
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 2a87b83
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 3600a63
moved add_mapping into metaclass
daniel-sanche 295f3a2
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 6ce1b5c
fixed mypy issues
daniel-sanche 6ac4c71
ignore unneeded mypy check
daniel-sanche d76cb5c
add mappings in __init__.py
daniel-sanche a36f89d
Merge branch 'main' into cross_sync2_pr1_architecture
daniel-sanche ceabe03
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 56cdbc1
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 449bb39
changed mapping method
daniel-sanche e5d6a29
added annotations for execute_query
daniel-sanche ebf126a
replace all instances in docstrings
daniel-sanche 3d8c79b
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 98d1fd9
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 2c926df
regenerated files
daniel-sanche 792abd9
added next to cross_sync
daniel-sanche 1006496
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 5dc231c
moved execute_query e2e tests from system to unit
daniel-sanche f73498c
ran blacken
daniel-sanche 6ecbf72
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche d884e5b
added execute_query tests
daniel-sanche 18854f0
added docstring templating
daniel-sanche 97d63e0
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 5396bc4
use templating in docstrings
daniel-sanche 86cb80f
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 1433136
regenerated files
daniel-sanche 2dce3b9
added test file for cross sync
daniel-sanche ade18b1
added some tests
daniel-sanche 933a626
moved wait into aliases
daniel-sanche 8efe71d
stripped out condition_wait
daniel-sanche 09623f4
added tests for event_wait
daniel-sanche 6fcbc89
added tests for create_task
daniel-sanche 9044c4a
added tests for remaining functions
daniel-sanche ee11e04
added test outline for decorators
daniel-sanche 89c2abe
added tests for ExportSync
daniel-sanche 7925b24
added tests for convert
daniel-sanche de32f7f
added remaining decorator tests
daniel-sanche 3c0f1de
added mapping tests
daniel-sanche da38ac4
added e2e test structure for cross_sync
daniel-sanche 169255b
fixed failing nox tests
daniel-sanche 5eddd03
added test cases
daniel-sanche c616143
added tests
daniel-sanche 042f89b
added cross_sync_methods e2e test cases
daniel-sanche f186d6b
added tests for class generation
daniel-sanche 7a0c638
moved cross_sync tests into system tests
daniel-sanche a3cb9a6
fixed lint issues
daniel-sanche 0c91eb7
fixed mypy
daniel-sanche 5484f5e
changed system_emulated version
daniel-sanche e7881da
fixed system test version format
daniel-sanche bc67b30
fixed unit-3.7 issues
daniel-sanche 11ab1d0
fixed lint
daniel-sanche bb9c160
added mutations batcher tests
daniel-sanche 06e0425
batcher uses multuple sync executors
daniel-sanche 288c645
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 13abfd4
implemented wait manually
daniel-sanche 93acd0d
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 49d5036
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 6ceb913
regenerated files
daniel-sanche 1318ab6
fixed order of executor close
daniel-sanche a38b985
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche fd4b779
updated generated code
daniel-sanche 8d15f48
changed num workers
daniel-sanche 8bdddf4
added noxfile step to generate sync
daniel-sanche bb2a539
added test for generated code
daniel-sanche 78c1405
added missing unit test deps
daniel-sanche b4608cb
run generate_sync from owlbot
daniel-sanche 7dc9a2b
simplified file processing
daniel-sanche aacd8aa
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 18484a2
updated CrossSync.export statements
daniel-sanche 93aac2a
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 41576f7
fixed issues in generation
daniel-sanche 7d5df6d
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 0b9f377
fixed lint
daniel-sanche 34833ef
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 8b13583
regenerated files
daniel-sanche 7eb6ac4
use consistent black version
daniel-sanche 0efb7f6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] d4224cc
changed black version
daniel-sanche c8d91c0
fixed underscores in annotations
daniel-sanche ef00397
fixed string access
daniel-sanche ea571bd
simplified transformers. Removed CrossSyncMethodHandler
daniel-sanche e42655b
simplified Convert decorator
daniel-sanche e972385
fixed 3.7 tests
daniel-sanche 81a06f8
fixed mypy issues
daniel-sanche db8c156
extract header from code
daniel-sanche c418af2
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche d0dcbff
fix mock import
daniel-sanche b382993
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 22d3e40
fix test_sync_up_to_date test
daniel-sanche c16ea30
fix annotations
daniel-sanche 37c3226
add warning to generated header
daniel-sanche 54ee3be
updated README
daniel-sanche d44b829
made drop_method into drop, with support for classes
daniel-sanche 61490e5
renamed export into convert_class
daniel-sanche ea0d5c4
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche b8b2181
use new decorator names
daniel-sanche 74368a2
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche c6fcd69
regenerate files
daniel-sanche 5e30192
removed unused annotation
daniel-sanche 26315e4
ran blacken
daniel-sanche a45a6f6
extracted branch trimming into own transformer
daniel-sanche 7052b31
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche be9c50d
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche dd2a65f
fixed visit to generic visit
daniel-sanche 0d487eb
import ExecuteQueryIterator
daniel-sanche a4a591b
added docs for sync files
daniel-sanche 5736661
add execute query iterators to cross sync mappings
daniel-sanche afe25fe
regenerated sync
daniel-sanche 59a5df2
update transformer value access
daniel-sanche 85f2bfd
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 1dc12c8
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 62d46ec
fixed py37 test
daniel-sanche 087167f
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche c3675ce
regenerate files
daniel-sanche 7dc78e1
fixed docfx
daniel-sanche 9725131
increase max depth
daniel-sanche 5a0fbba
put sync on top
daniel-sanche fd765a7
added notes to README
daniel-sanche 487f8b2
generate into _sync_autogen directories
daniel-sanche 77560c9
moved cross_sync directory
daniel-sanche 252ddef
fixed outdated name
daniel-sanche f34d9a2
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 3c806b5
fixed import path
daniel-sanche 8818628
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche fff417c
fixed import
daniel-sanche c346c56
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche e894845
moved files to _sync_autogen
daniel-sanche ab6fa6d
regenerated files
daniel-sanche 6e71ec9
fixed imports
daniel-sanche 720cf81
fixed import
daniel-sanche c82d967
moved tests
daniel-sanche 48d44a6
renamed test file
daniel-sanche 7c52d54
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche ea281a6
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 7f07436
rm_aio in decorator for async
daniel-sanche e4b2e9b
remove owlbot generation
daniel-sanche c2c28e6
improved error message
daniel-sanche dba89e6
added sanity check to sync_up_to_date
daniel-sanche 8cc4e07
use cross_sync for test proxy
daniel-sanche 3c175ae
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche a8f371c
updated conformance tests for sync client
daniel-sanche 20bb81d
fixed test proxy issues
daniel-sanche c75df5d
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 61e3339
updated test proxy files
daniel-sanche 601edf7
skip multistream conformance tests in sync surface
daniel-sanche 86651db
add skips into github actions file
daniel-sanche 2ab2e40
fixed typo
daniel-sanche 14a5f25
renamed with_formatter
daniel-sanche 8830375
fixed docstrings
daniel-sanche 6be8180
cleaning up rm_aio
daniel-sanche 54e3007
accept None as empty string
daniel-sanche 5811a98
use None for empty string
daniel-sanche 480b139
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 66fc807
move _MB_SIZE back to batcher
daniel-sanche 8b3b9c9
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 89a816a
removed rm_aio call annotations
daniel-sanche c6f053b
fixed broken imports
daniel-sanche bee3e84
rm_aio at function level by default
daniel-sanche 36c78ba
render to disk by default
daniel-sanche 3c44095
fixed lint
daniel-sanche 9244f56
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 6135ccc
fixed mypy issue
daniel-sanche ff9d019
fixed unit tests
daniel-sanche 56c76ef
Merge branch 'cross_sync2_pr1_architecture' into cross_sync2_pr2_anno…
daniel-sanche 8a2f3ed
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 26eeb0c
regnerated sync files
daniel-sanche ae5dc6a
Merge branch 'main' into cross_sync2_pr2_annotations
daniel-sanche c95ca68
addressing broken tests
daniel-sanche 4951b0f
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche e7ce0d0
regenerated files
daniel-sanche 7a1e422
removed unneeded import
daniel-sanche 008e724
fix tests
daniel-sanche 6945a48
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 2d04db7
fixed formatter param
daniel-sanche 7fb2134
fixed grace_period for sync client
daniel-sanche e8d122e
fixed lint
daniel-sanche d489ad3
cleaned up imports
daniel-sanche e0ab0b7
Merge branch 'cross_sync2_pr2_annotations' into cross_sync2_pr3_gener…
daniel-sanche 0d7d7ea
fixed lint
daniel-sanche 49c7059
Merge branch 'main' into cross_sync2_pr3_generated_sync
daniel-sanche 081a234
updated sync code
daniel-sanche d0768d3
fix docs issue
daniel-sanche 61707ca
remove new tests from this PR
daniel-sanche b245b78
removed missing lines
daniel-sanche b3d5993
renamed docs files
daniel-sanche e54f338
fixed index file name
daniel-sanche 216c4f1
fixed py3.7 issue
daniel-sanche f7d908a
made timings looser
daniel-sanche b3b63c4
added missing timezone in test
daniel-sanche 2f40ea2
allow more timed out requests in test
daniel-sanche 7365229
give larger time buffer for test
daniel-sanche 8e3334f
updated copyright dates
daniel-sanche e11f701
loosened test assertion
daniel-sanche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Data Client | ||
=========== | ||
|
||
Sync Surface | ||
------------ | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
sync_data_client | ||
sync_data_table | ||
sync_data_mutations_batcher | ||
sync_data_execute_query_iterator | ||
|
||
Async Surface | ||
------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
async_data_client | ||
async_data_table | ||
async_data_mutations_batcher | ||
async_data_execute_query_iterator | ||
|
||
Common Classes | ||
-------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
common_data_read_rows_query | ||
common_data_row | ||
common_data_row_filters | ||
common_data_mutations | ||
common_data_read_modify_write_rules | ||
common_data_exceptions | ||
common_data_execute_query_values | ||
common_data_execute_query_metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bigtable Data Client | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: google.cloud.bigtable.data.BigtableDataClient | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Execute Query Iterator | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: google.cloud.bigtable.data.execute_query.ExecuteQueryIterator | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Mutations Batcher | ||
~~~~~~~~~~~~~~~~~ | ||
|
||
.. automodule:: google.cloud.bigtable.data._sync_autogen.mutations_batcher | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Table | ||
~~~~~ | ||
|
||
.. autoclass:: google.cloud.bigtable.data.Table | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need cast() here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR: because comments aren't part of the ast, so
# type: ignore
doesn't make it through the generation process for the sync client. Buttyping.cast
does the same thing, by forcing the type checker to treat it as a specific type hereFor why we need to ignore the type in the first place: this is a check to raise a helpful error when the user passes in a
Mutation
instead of aRowMutationEntry
, which could be an easy mistake to make. But the type checker doesn't like this check, since we're checking if it's a type that it knows it should never beThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!