Skip to content

Commit 80f2505

Browse files
committed
update sdk
1 parent c213b83 commit 80f2505

File tree

6 files changed

+314
-327
lines changed

6 files changed

+314
-327
lines changed

dist/docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Python Source Plugin Template
2+
3+
This is the plugin documentation that will get published to Hub. Read more about publishing at [CloudQuery Docs](https://docs.cloudquery.io/docs/developers/publishing-a-plugin-to-the-hub)

dist/tables.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"name": "example_item", "title": "Example Item", "description": "", "is_incremental": false, "parent": "", "relations": [], "columns": [{"name": "num", "type": "uint64", "description": "", "incremental_key": false, "primary_key": true, "not_null": false, "unique": false}, {"name": "string", "type": "string", "description": "", "incremental_key": false, "primary_key": false, "not_null": false, "unique": false}, {"name": "date", "type": "date64[ms]", "description": "", "incremental_key": false, "primary_key": false, "not_null": false, "unique": false}]}]

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Python Source Plugin Template
2+
3+
This is the plugin documentation that will get published to Hub. Read more about publishing at [CloudQuery Docs](https://docs.cloudquery.io/docs/developers/publishing-a-plugin-to-the-hub)

plugin/plugin.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212

1313
PLUGIN_NAME = "example"
1414
PLUGIN_VERSION = "1.0.0" # {x-release-please-version}
15+
TEAM_NAME = "cloudquery"
16+
PLUGIN_KIND = "source"
1517

1618

1719
class ExamplePlugin(plugin.Plugin):
1820
def __init__(self) -> None:
19-
super().__init__(PLUGIN_NAME, PLUGIN_VERSION)
21+
super().__init__(
22+
PLUGIN_NAME, PLUGIN_VERSION, plugin.plugin.Options(team=TEAM_NAME, kind=PLUGIN_KIND)
23+
)
2024
self._spec_json = None
2125
self._spec = None
2226
self._scheduler = None
@@ -26,10 +30,10 @@ def __init__(self) -> None:
2630
def set_logger(self, logger) -> None:
2731
self._logger = logger
2832

29-
def init(self, spec_bytes, no_connection: bool = False):
33+
def init(self, spec, no_connection: bool = False):
3034
if no_connection:
3135
return
32-
self._spec_json = json.loads(spec_bytes)
36+
self._spec_json = json.loads(spec)
3337
self._spec = Spec(**self._spec_json)
3438
self._spec.validate()
3539
self._scheduler = Scheduler(

0 commit comments

Comments
 (0)