From 021deb80c83bb701a219bc149c7313151c8839bb Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Fri, 28 Jul 2023 10:25:06 +0200 Subject: [PATCH 01/11] chore: Create renovate.json5 (#3) --- .github/renovate.json5 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..a139bff --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,3 @@ +{ + extends: ["github>cloudquery/.github//.github/renovate-python-default.json5"], +} From 7fcc8145ddbd983de0c7b400d806d10db93e496f Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Fri, 28 Jul 2023 11:11:25 +0200 Subject: [PATCH 02/11] chore(ci): Add lint, test, regen workflows (#4) --- .github/workflows/lint.yml | 21 ++++++++++++++++++++ .github/workflows/publish.yml | 1 - .github/workflows/regen.yml | 36 ++++++++++++++++++++++++++++++++++ .github/workflows/unittest.yml | 23 ++++++++++++++++++++++ Makefile | 10 +++++++++- requirements.txt | 5 ++++- samples/plugin_client.py | 6 ++++-- samples/plugin_server.py | 7 +++---- setup.py | 11 +++++++++-- tests/plugin_v3/arrow.py | 16 --------------- tests/plugin_v3/arrow_test.py | 27 +++++++++++++++++++++++++ 11 files changed, 136 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/regen.yml create mode 100644 .github/workflows/unittest.yml delete mode 100644 tests/plugin_v3/arrow.py create mode 100644 tests/plugin_v3/arrow_test.py diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7ce2828 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint with Black + +on: + pull_request: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: pip install -r requirements.txt + - name: Check formatting + run: make fmt-check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c0dd026..858503f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,6 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -r requirements.txt pip install build - name: Build package diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml new file mode 100644 index 0000000..84e285a --- /dev/null +++ b/.github/workflows/regen.yml @@ -0,0 +1,36 @@ +name: Generate Python Code from plugin-pb +on: + schedule: + - cron: "0 8 * * *" + workflow_dispatch: + +jobs: + regen: + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: | + pip install -r requirements.txt + - name: Generate code + run: | + make clone-proto + make gen-proto + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + # required so the PR triggers workflow runs + token: ${{ secrets.GH_CQ_BOT }} + branch: fix/gen_proto + base: main + title: "fix: Generate Python Code from `plugin-pb`" + commit-message: "fix: Generate Python Code from `plugin-pb`" + body: This PR was created by a scheduled workflow to regenerate the Python code from `plugin-pb`. + author: cq-bot + labels: automerge diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..fd91639 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,23 @@ +name: Test + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: pip install -r requirements.txt + - name: Run tests + run: make test diff --git a/Makefile b/Makefile index 79c1a70..a4f0c40 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,16 @@ +test: + pytest . + +fmt: + black . --exclude=cloudquery + +fmt-check: + black --check . --exclude=cloudquery clone-proto: git clone https://github.com/cloudquery/plugin-pb -gen: +gen-proto: cd plugin-pb && git pull && cd .. mkdir -p ./protos/cloudquery/plugin_v3 diff --git a/requirements.txt b/requirements.txt index 6314f5c..bf86f81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,6 @@ -grpcio==1.56.0 +black==23.7.0 grpcio-tools==1.56.0 +grpcio==1.56.0 protobuf==4.23.4 +pyarrow==12.0.1 +pytest==7.4.0 \ No newline at end of file diff --git a/samples/plugin_client.py b/samples/plugin_client.py index c85e440..820db2a 100644 --- a/samples/plugin_client.py +++ b/samples/plugin_client.py @@ -2,15 +2,17 @@ import grpc from cloudquery.plugin_v3 import plugin_pb2, plugin_pb2_grpc + def run(): # NOTE(gRPC Python Team): .close() is possible on a channel and should be # used in circumstances in which the with statement does not fit the needs # of the code. - with grpc.insecure_channel('localhost:50051') as channel: + with grpc.insecure_channel("localhost:50051") as channel: stub = plugin_pb2_grpc.PluginStub(channel) response = stub.GetName(plugin_pb2.GetName.Request()) print(response.name) -if __name__ == '__main__': + +if __name__ == "__main__": logging.basicConfig() run() diff --git a/samples/plugin_server.py b/samples/plugin_server.py index db03900..8b82a6b 100644 --- a/samples/plugin_server.py +++ b/samples/plugin_server.py @@ -39,14 +39,13 @@ def Close(self, request, context): def serve(): server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) - plugin_pb2_grpc.add_PluginServicer_to_server( - PluginServicer(), server) - server.add_insecure_port('[::]:50051') + plugin_pb2_grpc.add_PluginServicer_to_server(PluginServicer(), server) + server.add_insecure_port("[::]:50051") print("Starting server. Listening on port 50051") server.start() server.wait_for_termination() -if __name__ == '__main__': +if __name__ == "__main__": logging.basicConfig() serve() diff --git a/setup.py b/setup.py index 00096cf..1cec026 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ "grpcio >= 1.56.0", "grpcio-tools >= 1.56.0", "protobuf >= 4.23.4", - "pyarrow >= 12.0.1" + "pyarrow >= 12.0.1", ] url = "https://github.com/cloudquery/plugin-pb-python" @@ -65,6 +65,13 @@ # namespace_packages=namespaces, install_requires=dependencies, include_package_data=True, - package_data={"cloudquery": ["plugin_v3/py.typed", "plugin_v3/*.pyi", "discovery_v1/py.typed", "discovery_v1/*.pyi"]}, + package_data={ + "cloudquery": [ + "plugin_v3/py.typed", + "plugin_v3/*.pyi", + "discovery_v1/py.typed", + "discovery_v1/*.pyi", + ] + }, zip_safe=False, ) diff --git a/tests/plugin_v3/arrow.py b/tests/plugin_v3/arrow.py deleted file mode 100644 index 513207a..0000000 --- a/tests/plugin_v3/arrow.py +++ /dev/null @@ -1,16 +0,0 @@ -import pyarrow as pa -from cloudquery.plugin_v3.arrow import schemas_to_bytes, new_schemas_from_bytes, record_to_bytes, new_record_from_bytes - -def test_schema_round_trip(): - sc = pa.schema(fields=[pa.field("a", pa.int64())], metadata={"foo":"bar", "baz":"quux"}) - b = schemas_to_bytes([sc]) - schemas = new_schemas_from_bytes(b) - assert len(schemas) == 1 - assert schemas[0].equals(sc) - -def test_record_round_trip(): - sc = pa.schema(fields=[pa.field("a", pa.int64())], metadata={"foo":"bar", "baz":"quux"}) - rec = pa.RecordBatch.from_arrays([pa.array([1,2,3])], schema=sc) - b = record_to_bytes(rec) - rec2 = new_record_from_bytes(b) - assert rec.equals(rec2) diff --git a/tests/plugin_v3/arrow_test.py b/tests/plugin_v3/arrow_test.py new file mode 100644 index 0000000..c137c77 --- /dev/null +++ b/tests/plugin_v3/arrow_test.py @@ -0,0 +1,27 @@ +import pyarrow as pa +from cloudquery.plugin_v3.arrow import ( + schemas_to_bytes, + new_schemas_from_bytes, + record_to_bytes, + new_record_from_bytes, +) + + +def test_schema_round_trip(): + sc = pa.schema( + fields=[pa.field("a", pa.int64())], metadata={"foo": "bar", "baz": "quux"} + ) + b = schemas_to_bytes([sc]) + schemas = new_schemas_from_bytes(b) + assert len(schemas) == 1 + assert schemas[0].equals(sc) + + +def test_record_round_trip(): + sc = pa.schema( + fields=[pa.field("a", pa.int64())], metadata={"foo": "bar", "baz": "quux"} + ) + rec = pa.RecordBatch.from_arrays([pa.array([1, 2, 3])], schema=sc) + b = record_to_bytes(rec) + rec2 = new_record_from_bytes(b) + assert rec.equals(rec2) From 1ca3073828dfedc6ffbc2debefcb642bf13e66f7 Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Fri, 28 Jul 2023 14:37:31 +0200 Subject: [PATCH 03/11] chore: Add PR title workflow (#6) --- .github/workflows/pr_title.yml | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/pr_title.yml diff --git a/.github/workflows/pr_title.yml b/.github/workflows/pr_title.yml new file mode 100644 index 0000000..c44b736 --- /dev/null +++ b/.github/workflows/pr_title.yml @@ -0,0 +1,52 @@ +name: "Validate PR title" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + # Please look up the latest version from + # https://github.com/amannn/action-semantic-pull-request/releases + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed. + # Default: https://github.com/commitizen/conventional-commit-types + types: | + fix + feat + chore + refactor + test + # Configure that a scope must always be provided. + requireScope: false + # Configure additional validation for the subject based on a regex. + # This example ensures the subject starts with an uppercase character. + subjectPattern: ^[A-Z].+$ + # If `subjectPattern` is configured, you can use this property to override + # the default error message that is shown when the pattern doesn't match. + # The variables `subject` and `title` can be used within the message. + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + starts with an uppercase character. + # For work-in-progress PRs you can typically use draft pull requests + # from Github. However, private repositories on the free plan don't have + # this option and therefore this action allows you to opt-in to using the + # special "[WIP]" prefix to indicate this state. This will avoid the + # validation of the PR title and the pull request checks remain pending. + # Note that a second check will be reported if this is enabled. + wip: true + # When using "Squash and merge" on a PR with only one commit, GitHub + # will suggest using that commit message instead of the PR title for the + # merge commit, and it's easy to commit this by mistake. Enable this option + # to also validate the commit message for one commit PRs. + validateSingleCommit: false From c217fc6e3eaf5d5da82e24ab90deaf7fb78082f2 Mon Sep 17 00:00:00 2001 From: Kemal <223029+disq@users.noreply.github.com> Date: Fri, 28 Jul 2023 18:21:22 +0100 Subject: [PATCH 04/11] feat: Run all tests (#7) --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..7dab082 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +python_files = tests/*.py From 5330bc450ba82a453ef0d44936688650ed9748dc Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 03:37:55 +0300 Subject: [PATCH 05/11] fix(deps): Update dependency grpcio to v1.56.2 (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Update | Change | |---|---|---| | [grpcio](https://grpc.io) ([source](https://togithub.com/grpc/grpc)) | patch | `==1.56.0` -> `==1.56.2` | --- ### Release Notes
grpc/grpc (grpcio) ### [`v1.56.2`](https://togithub.com/grpc/grpc/releases/tag/v1.56.2) [Compare Source](https://togithub.com/grpc/grpc/compare/v1.56.0...v1.56.2) This is release gRPC Core 1.56.2 (galvanized). For gRPC documentation, see [grpc.io](https://grpc.io/). For previous releases, see [Releases](https://togithub.com/grpc/grpc/releases). This release contains refinements, improvements, and bug fixes. ## Core - \[WRR] backport ([#​33694](https://togithub.com/grpc/grpc/pull/33694)) to 1.56 ([#​33698](https://togithub.com/grpc/grpc/pull/33698)) - \[backport]\[iomgr]\[EventEngine] Improve server handling of file descriptor exhaustion ([#​33667](https://togithub.com/grpc/grpc/pull/33667))
--- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bf86f81..5871d75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ black==23.7.0 grpcio-tools==1.56.0 -grpcio==1.56.0 +grpcio==1.56.2 protobuf==4.23.4 pyarrow==12.0.1 pytest==7.4.0 \ No newline at end of file From 66b4addefa2e337b5a7960d902460bcc53df7254 Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 04:42:15 +0300 Subject: [PATCH 06/11] fix(deps): Update dependency grpcio-tools to v1.56.2 (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Update | Change | |---|---|---| | [grpcio-tools](https://grpc.io) | patch | `==1.56.0` -> `==1.56.2` | --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5871d75..3beab03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ black==23.7.0 -grpcio-tools==1.56.0 +grpcio-tools==1.56.2 grpcio==1.56.2 protobuf==4.23.4 pyarrow==12.0.1 From 5bcc64da290661a2a126d87bff311bc49a95b89a Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:37:47 +0300 Subject: [PATCH 07/11] chore(deps): Update peter-evans/create-pull-request action to v5 (#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [peter-evans/create-pull-request](https://togithub.com/peter-evans/create-pull-request) | action | major | `v4` -> `v5` | --- ### Release Notes
peter-evans/create-pull-request (peter-evans/create-pull-request) ### [`v5`](https://togithub.com/peter-evans/create-pull-request/compare/v4...v5) [Compare Source](https://togithub.com/peter-evans/create-pull-request/compare/v4...v5)
--- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). --- .github/workflows/regen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml index 84e285a..ab67c80 100644 --- a/.github/workflows/regen.yml +++ b/.github/workflows/regen.yml @@ -23,7 +23,7 @@ jobs: make clone-proto make gen-proto - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: # required so the PR triggers workflow runs token: ${{ secrets.GH_CQ_BOT }} From 9b13b7bee05ef0fe30f29de1b12f25939d012d44 Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Wed, 2 Aug 2023 16:29:51 +0200 Subject: [PATCH 08/11] chore: Fix typo (#12) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10f66f5..0239893 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # plugin-pb-python -This is a low-level auto-generate gRPC client and server for CloudQuery plugin from [plugin-pb protos](https://github.com/cloudquery/plugin-pb). +This is a low-level auto-generated gRPC client and server for CloudQuery plugin from [plugin-pb protos](https://github.com/cloudquery/plugin-pb). ## Development From 29c0241d7229eb45f558dff4f7b791ffe77b9f76 Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:41:09 +0300 Subject: [PATCH 09/11] fix: Generate Python Code from `plugin-pb` (#13) This PR was created by a scheduled workflow to regenerate the Python code from `plugin-pb`. --- cloudquery/discovery_v1/discovery_pb2.py | 4 ++-- cloudquery/plugin_v3/plugin_pb2.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudquery/discovery_v1/discovery_pb2.py b/cloudquery/discovery_v1/discovery_pb2.py index ad78cf8..0f4806a 100644 --- a/cloudquery/discovery_v1/discovery_pb2.py +++ b/cloudquery/discovery_v1/discovery_pb2.py @@ -13,7 +13,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'cloudquery/discovery_v1/discovery.proto\x12\x17\x63loudquery.discovery.v1\"6\n\x0bGetVersions\x1a\t\n\x07Request\x1a\x1c\n\x08Response\x12\x10\n\x08versions\x18\x01 \x03(\x05\x32w\n\tDiscovery\x12j\n\x0bGetVersions\x12,.cloudquery.discovery.v1.GetVersions.Request\x1a-.cloudquery.discovery.v1.GetVersions.ResponseB>Z Date: Tue, 8 Aug 2023 16:54:17 +0300 Subject: [PATCH 10/11] fix: Generate Python Code from `plugin-pb` (#14) Co-authored-by: cq-bot --- cloudquery/plugin_v3/plugin_pb2.py | 74 ++++++++++++++--------------- cloudquery/plugin_v3/plugin_pb2.pyi | 6 ++- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/cloudquery/plugin_v3/plugin_pb2.py b/cloudquery/plugin_v3/plugin_pb2.py index 0ee5e43..93c67a0 100644 --- a/cloudquery/plugin_v3/plugin_pb2.py +++ b/cloudquery/plugin_v3/plugin_pb2.py @@ -14,7 +14,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!cloudquery/plugin_v3/plugin.proto\x12\x14\x63loudquery.plugin.v3\x1a\x1fgoogle/protobuf/timestamp.proto\".\n\x07GetName\x1a\t\n\x07Request\x1a\x18\n\x08Response\x12\x0c\n\x04name\x18\x01 \x01(\t\"4\n\nGetVersion\x1a\t\n\x07Request\x1a\x1b\n\x08Response\x12\x0f\n\x07version\x18\x01 \x01(\t\"B\n\x04Init\x1a.\n\x07Request\x12\x0c\n\x04spec\x18\x01 \x01(\x0c\x12\x15\n\rno_connection\x18\x02 \x01(\x08\x1a\n\n\x08Response\"W\n\tGetTables\x1a.\n\x07Request\x12\x0e\n\x06tables\x18\x01 \x03(\t\x12\x13\n\x0bskip_tables\x18\x02 \x03(\t\x1a\x1a\n\x08Response\x12\x0e\n\x06tables\x18\x01 \x03(\x0c\"\xcd\x03\n\x04Sync\x1a\x1f\n\rMessageInsert\x12\x0e\n\x06record\x18\x01 \x01(\x0c\x1a$\n\x13MessageMigrateTable\x12\r\n\x05table\x18\x01 \x01(\x0c\x1a\x38\n\x0e\x42\x61\x63kendOptions\x12\x12\n\ntable_name\x18\x01 \x01(\t\x12\x12\n\nconnection\x18\x02 \x01(\t\x1a\xa6\x01\n\x07Request\x12\x0e\n\x06tables\x18\x01 \x03(\t\x12\x13\n\x0bskip_tables\x18\x02 \x03(\t\x12\x1d\n\x15skip_dependent_tables\x18\x03 \x01(\x08\x12\x1b\n\x13\x64\x65terministic_cq_id\x18\x04 \x01(\x08\x12:\n\x07\x62\x61\x63kend\x18\x05 \x01(\x0b\x32).cloudquery.plugin.v3.Sync.BackendOptions\x1a\x9a\x01\n\x08Response\x12G\n\rmigrate_table\x18\x01 \x01(\x0b\x32..cloudquery.plugin.v3.Sync.MessageMigrateTableH\x00\x12:\n\x06insert\x18\x02 \x01(\x0b\x32(.cloudquery.plugin.v3.Sync.MessageInsertH\x00\x42\t\n\x07message\"<\n\x04Read\x1a\x18\n\x07Request\x12\r\n\x05table\x18\x01 \x01(\x0c\x1a\x1a\n\x08Response\x12\x0e\n\x06record\x18\x01 \x01(\x0c\"\xd2\x03\n\x05Write\x1a;\n\x13MessageMigrateTable\x12\r\n\x05table\x18\x01 \x01(\x0c\x12\x15\n\rmigrate_force\x18\x02 \x01(\x08\x1a\x1f\n\rMessageInsert\x12\x0e\n\x06record\x18\x01 \x01(\x0c\x1a\x7f\n\x12MessageDeleteStale\x12\x11\n\x05table\x18\x01 \x01(\x0c\x42\x02\x18\x01\x12\x13\n\x0bsource_name\x18\x02 \x01(\t\x12-\n\tsync_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ntable_name\x18\x04 \x01(\t\x1a\xdd\x01\n\x07Request\x12H\n\rmigrate_table\x18\x01 \x01(\x0b\x32/.cloudquery.plugin.v3.Write.MessageMigrateTableH\x00\x12;\n\x06insert\x18\x02 \x01(\x0b\x32).cloudquery.plugin.v3.Write.MessageInsertH\x00\x12@\n\x06\x64\x65lete\x18\x03 \x01(\x0b\x32..cloudquery.plugin.v3.Write.MessageDeleteStaleH\x00\x42\t\n\x07message\x1a\n\n\x08Response\"\x1e\n\x05\x43lose\x1a\t\n\x07Request\x1a\n\n\x08Response2\xc6\x05\n\x06Plugin\x12X\n\x07GetName\x12%.cloudquery.plugin.v3.GetName.Request\x1a&.cloudquery.plugin.v3.GetName.Response\x12\x61\n\nGetVersion\x12(.cloudquery.plugin.v3.GetVersion.Request\x1a).cloudquery.plugin.v3.GetVersion.Response\x12O\n\x04Init\x12\".cloudquery.plugin.v3.Init.Request\x1a#.cloudquery.plugin.v3.Init.Response\x12^\n\tGetTables\x12\'.cloudquery.plugin.v3.GetTables.Request\x1a(.cloudquery.plugin.v3.GetTables.Response\x12Q\n\x04Sync\x12\".cloudquery.plugin.v3.Sync.Request\x1a#.cloudquery.plugin.v3.Sync.Response0\x01\x12Q\n\x04Read\x12\".cloudquery.plugin.v3.Read.Request\x1a#.cloudquery.plugin.v3.Read.Response0\x01\x12T\n\x05Write\x12#.cloudquery.plugin.v3.Write.Request\x1a$.cloudquery.plugin.v3.Write.Response(\x01\x12R\n\x05\x43lose\x12#.cloudquery.plugin.v3.Close.Request\x1a$.cloudquery.plugin.v3.Close.ResponseBS\n\x17io.cloudquery.plugin.v3P\x01Z6github.com/cloudquery/plugin-pb-go/pb/plugin/v3;pluginb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!cloudquery/plugin_v3/plugin.proto\x12\x14\x63loudquery.plugin.v3\x1a\x1fgoogle/protobuf/timestamp.proto\".\n\x07GetName\x1a\t\n\x07Request\x1a\x18\n\x08Response\x12\x0c\n\x04name\x18\x01 \x01(\t\"4\n\nGetVersion\x1a\t\n\x07Request\x1a\x1b\n\x08Response\x12\x0f\n\x07version\x18\x01 \x01(\t\"B\n\x04Init\x1a.\n\x07Request\x12\x0c\n\x04spec\x18\x01 \x01(\x0c\x12\x15\n\rno_connection\x18\x02 \x01(\x08\x1a\n\n\x08Response\"v\n\tGetTables\x1aM\n\x07Request\x12\x0e\n\x06tables\x18\x01 \x03(\t\x12\x13\n\x0bskip_tables\x18\x02 \x03(\t\x12\x1d\n\x15skip_dependent_tables\x18\x03 \x01(\x08\x1a\x1a\n\x08Response\x12\x0e\n\x06tables\x18\x01 \x03(\x0c\"\xcd\x03\n\x04Sync\x1a\x1f\n\rMessageInsert\x12\x0e\n\x06record\x18\x01 \x01(\x0c\x1a$\n\x13MessageMigrateTable\x12\r\n\x05table\x18\x01 \x01(\x0c\x1a\x38\n\x0e\x42\x61\x63kendOptions\x12\x12\n\ntable_name\x18\x01 \x01(\t\x12\x12\n\nconnection\x18\x02 \x01(\t\x1a\xa6\x01\n\x07Request\x12\x0e\n\x06tables\x18\x01 \x03(\t\x12\x13\n\x0bskip_tables\x18\x02 \x03(\t\x12\x1d\n\x15skip_dependent_tables\x18\x03 \x01(\x08\x12\x1b\n\x13\x64\x65terministic_cq_id\x18\x04 \x01(\x08\x12:\n\x07\x62\x61\x63kend\x18\x05 \x01(\x0b\x32).cloudquery.plugin.v3.Sync.BackendOptions\x1a\x9a\x01\n\x08Response\x12G\n\rmigrate_table\x18\x01 \x01(\x0b\x32..cloudquery.plugin.v3.Sync.MessageMigrateTableH\x00\x12:\n\x06insert\x18\x02 \x01(\x0b\x32(.cloudquery.plugin.v3.Sync.MessageInsertH\x00\x42\t\n\x07message\"<\n\x04Read\x1a\x18\n\x07Request\x12\r\n\x05table\x18\x01 \x01(\x0c\x1a\x1a\n\x08Response\x12\x0e\n\x06record\x18\x01 \x01(\x0c\"\xd2\x03\n\x05Write\x1a;\n\x13MessageMigrateTable\x12\r\n\x05table\x18\x01 \x01(\x0c\x12\x15\n\rmigrate_force\x18\x02 \x01(\x08\x1a\x1f\n\rMessageInsert\x12\x0e\n\x06record\x18\x01 \x01(\x0c\x1a\x7f\n\x12MessageDeleteStale\x12\x11\n\x05table\x18\x01 \x01(\x0c\x42\x02\x18\x01\x12\x13\n\x0bsource_name\x18\x02 \x01(\t\x12-\n\tsync_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ntable_name\x18\x04 \x01(\t\x1a\xdd\x01\n\x07Request\x12H\n\rmigrate_table\x18\x01 \x01(\x0b\x32/.cloudquery.plugin.v3.Write.MessageMigrateTableH\x00\x12;\n\x06insert\x18\x02 \x01(\x0b\x32).cloudquery.plugin.v3.Write.MessageInsertH\x00\x12@\n\x06\x64\x65lete\x18\x03 \x01(\x0b\x32..cloudquery.plugin.v3.Write.MessageDeleteStaleH\x00\x42\t\n\x07message\x1a\n\n\x08Response\"\x1e\n\x05\x43lose\x1a\t\n\x07Request\x1a\n\n\x08Response2\xc6\x05\n\x06Plugin\x12X\n\x07GetName\x12%.cloudquery.plugin.v3.GetName.Request\x1a&.cloudquery.plugin.v3.GetName.Response\x12\x61\n\nGetVersion\x12(.cloudquery.plugin.v3.GetVersion.Request\x1a).cloudquery.plugin.v3.GetVersion.Response\x12O\n\x04Init\x12\".cloudquery.plugin.v3.Init.Request\x1a#.cloudquery.plugin.v3.Init.Response\x12^\n\tGetTables\x12\'.cloudquery.plugin.v3.GetTables.Request\x1a(.cloudquery.plugin.v3.GetTables.Response\x12Q\n\x04Sync\x12\".cloudquery.plugin.v3.Sync.Request\x1a#.cloudquery.plugin.v3.Sync.Response0\x01\x12Q\n\x04Read\x12\".cloudquery.plugin.v3.Read.Request\x1a#.cloudquery.plugin.v3.Read.Response0\x01\x12T\n\x05Write\x12#.cloudquery.plugin.v3.Write.Request\x1a$.cloudquery.plugin.v3.Write.Response(\x01\x12R\n\x05\x43lose\x12#.cloudquery.plugin.v3.Close.Request\x1a$.cloudquery.plugin.v3.Close.ResponseBS\n\x17io.cloudquery.plugin.v3P\x01Z6github.com/cloudquery/plugin-pb-go/pb/plugin/v3;pluginb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -44,47 +44,47 @@ _globals['_INIT_RESPONSE']._serialized_start=114 _globals['_INIT_RESPONSE']._serialized_end=124 _globals['_GETTABLES']._serialized_start=262 - _globals['_GETTABLES']._serialized_end=349 + _globals['_GETTABLES']._serialized_end=380 _globals['_GETTABLES_REQUEST']._serialized_start=275 - _globals['_GETTABLES_REQUEST']._serialized_end=321 - _globals['_GETTABLES_RESPONSE']._serialized_start=323 - _globals['_GETTABLES_RESPONSE']._serialized_end=349 - _globals['_SYNC']._serialized_start=352 - _globals['_SYNC']._serialized_end=813 - _globals['_SYNC_MESSAGEINSERT']._serialized_start=360 - _globals['_SYNC_MESSAGEINSERT']._serialized_end=391 - _globals['_SYNC_MESSAGEMIGRATETABLE']._serialized_start=393 - _globals['_SYNC_MESSAGEMIGRATETABLE']._serialized_end=429 - _globals['_SYNC_BACKENDOPTIONS']._serialized_start=431 - _globals['_SYNC_BACKENDOPTIONS']._serialized_end=487 - _globals['_SYNC_REQUEST']._serialized_start=490 - _globals['_SYNC_REQUEST']._serialized_end=656 - _globals['_SYNC_RESPONSE']._serialized_start=659 - _globals['_SYNC_RESPONSE']._serialized_end=813 - _globals['_READ']._serialized_start=815 - _globals['_READ']._serialized_end=875 - _globals['_READ_REQUEST']._serialized_start=823 - _globals['_READ_REQUEST']._serialized_end=847 - _globals['_READ_RESPONSE']._serialized_start=849 - _globals['_READ_RESPONSE']._serialized_end=875 - _globals['_WRITE']._serialized_start=878 - _globals['_WRITE']._serialized_end=1344 - _globals['_WRITE_MESSAGEMIGRATETABLE']._serialized_start=887 - _globals['_WRITE_MESSAGEMIGRATETABLE']._serialized_end=946 - _globals['_WRITE_MESSAGEINSERT']._serialized_start=360 - _globals['_WRITE_MESSAGEINSERT']._serialized_end=391 - _globals['_WRITE_MESSAGEDELETESTALE']._serialized_start=981 - _globals['_WRITE_MESSAGEDELETESTALE']._serialized_end=1108 - _globals['_WRITE_REQUEST']._serialized_start=1111 - _globals['_WRITE_REQUEST']._serialized_end=1332 + _globals['_GETTABLES_REQUEST']._serialized_end=352 + _globals['_GETTABLES_RESPONSE']._serialized_start=354 + _globals['_GETTABLES_RESPONSE']._serialized_end=380 + _globals['_SYNC']._serialized_start=383 + _globals['_SYNC']._serialized_end=844 + _globals['_SYNC_MESSAGEINSERT']._serialized_start=391 + _globals['_SYNC_MESSAGEINSERT']._serialized_end=422 + _globals['_SYNC_MESSAGEMIGRATETABLE']._serialized_start=424 + _globals['_SYNC_MESSAGEMIGRATETABLE']._serialized_end=460 + _globals['_SYNC_BACKENDOPTIONS']._serialized_start=462 + _globals['_SYNC_BACKENDOPTIONS']._serialized_end=518 + _globals['_SYNC_REQUEST']._serialized_start=521 + _globals['_SYNC_REQUEST']._serialized_end=687 + _globals['_SYNC_RESPONSE']._serialized_start=690 + _globals['_SYNC_RESPONSE']._serialized_end=844 + _globals['_READ']._serialized_start=846 + _globals['_READ']._serialized_end=906 + _globals['_READ_REQUEST']._serialized_start=854 + _globals['_READ_REQUEST']._serialized_end=878 + _globals['_READ_RESPONSE']._serialized_start=880 + _globals['_READ_RESPONSE']._serialized_end=906 + _globals['_WRITE']._serialized_start=909 + _globals['_WRITE']._serialized_end=1375 + _globals['_WRITE_MESSAGEMIGRATETABLE']._serialized_start=918 + _globals['_WRITE_MESSAGEMIGRATETABLE']._serialized_end=977 + _globals['_WRITE_MESSAGEINSERT']._serialized_start=391 + _globals['_WRITE_MESSAGEINSERT']._serialized_end=422 + _globals['_WRITE_MESSAGEDELETESTALE']._serialized_start=1012 + _globals['_WRITE_MESSAGEDELETESTALE']._serialized_end=1139 + _globals['_WRITE_REQUEST']._serialized_start=1142 + _globals['_WRITE_REQUEST']._serialized_end=1363 _globals['_WRITE_RESPONSE']._serialized_start=114 _globals['_WRITE_RESPONSE']._serialized_end=124 - _globals['_CLOSE']._serialized_start=1346 - _globals['_CLOSE']._serialized_end=1376 + _globals['_CLOSE']._serialized_start=1377 + _globals['_CLOSE']._serialized_end=1407 _globals['_CLOSE_REQUEST']._serialized_start=103 _globals['_CLOSE_REQUEST']._serialized_end=112 _globals['_CLOSE_RESPONSE']._serialized_start=114 _globals['_CLOSE_RESPONSE']._serialized_end=124 - _globals['_PLUGIN']._serialized_start=1379 - _globals['_PLUGIN']._serialized_end=2089 + _globals['_PLUGIN']._serialized_start=1410 + _globals['_PLUGIN']._serialized_end=2120 # @@protoc_insertion_point(module_scope) diff --git a/cloudquery/plugin_v3/plugin_pb2.pyi b/cloudquery/plugin_v3/plugin_pb2.pyi index 7bdc96c..ab0ee4c 100644 --- a/cloudquery/plugin_v3/plugin_pb2.pyi +++ b/cloudquery/plugin_v3/plugin_pb2.pyi @@ -47,12 +47,14 @@ class Init(_message.Message): class GetTables(_message.Message): __slots__ = [] class Request(_message.Message): - __slots__ = ["tables", "skip_tables"] + __slots__ = ["tables", "skip_tables", "skip_dependent_tables"] TABLES_FIELD_NUMBER: _ClassVar[int] SKIP_TABLES_FIELD_NUMBER: _ClassVar[int] + SKIP_DEPENDENT_TABLES_FIELD_NUMBER: _ClassVar[int] tables: _containers.RepeatedScalarFieldContainer[str] skip_tables: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, tables: _Optional[_Iterable[str]] = ..., skip_tables: _Optional[_Iterable[str]] = ...) -> None: ... + skip_dependent_tables: bool + def __init__(self, tables: _Optional[_Iterable[str]] = ..., skip_tables: _Optional[_Iterable[str]] = ..., skip_dependent_tables: bool = ...) -> None: ... class Response(_message.Message): __slots__ = ["tables"] TABLES_FIELD_NUMBER: _ClassVar[int] From e9e9c543ca03e744f9db2fc72e23d75a804adad7 Mon Sep 17 00:00:00 2001 From: CloudQuery Bot <102256036+cq-bot@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:59:16 +0300 Subject: [PATCH 11/11] chore(main): Release v0.0.15 (#10) --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..78a6a2b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## [0.0.15](https://github.com/cloudquery/plugin-pb-python/compare/v0.0.14...v0.0.15) (2023-08-08) + + +### Bug Fixes + +* **deps:** Update dependency grpcio to v1.56.2 ([#8](https://github.com/cloudquery/plugin-pb-python/issues/8)) ([5330bc4](https://github.com/cloudquery/plugin-pb-python/commit/5330bc450ba82a453ef0d44936688650ed9748dc)) +* **deps:** Update dependency grpcio-tools to v1.56.2 ([#9](https://github.com/cloudquery/plugin-pb-python/issues/9)) ([66b4add](https://github.com/cloudquery/plugin-pb-python/commit/66b4addefa2e337b5a7960d902460bcc53df7254)) +* Generate Python Code from `plugin-pb` ([#13](https://github.com/cloudquery/plugin-pb-python/issues/13)) ([29c0241](https://github.com/cloudquery/plugin-pb-python/commit/29c0241d7229eb45f558dff4f7b791ffe77b9f76)) +* Generate Python Code from `plugin-pb` ([#14](https://github.com/cloudquery/plugin-pb-python/issues/14)) ([b5be5c6](https://github.com/cloudquery/plugin-pb-python/commit/b5be5c64442791a5fa5b71176112fd0449ae5c34)) diff --git a/setup.py b/setup.py index 1cec026..f3bc24d 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ ] setuptools.setup( name=name, - version="0.0.14", + version="0.0.15", description=description, long_description=long_description, author="CloudQuery LTD",