Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions cloudquery/sdk/scalar/scalar_factory.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import pyarrow as pa
from .scalar import ScalarInvalidTypeError

from cloudquery.sdk.types import UUIDType, JSONType
from .binary import Binary
from .bool import Bool
from .date32 import Date32
from .date64 import Date64
from .float import Float
from .int import Int
from .list import List
from .scalar import ScalarInvalidTypeError
from .string import String
from .timestamp import Timestamp
from .uint import Uint
from .uuid import UUID
from cloudquery.sdk.types import UUIDType, JSONType


class ScalarFactory:
Expand Down Expand Up @@ -85,9 +86,9 @@ def new_scalar(self, dt: pa.DataType):
# return ()
elif dt_id == pa.types.lib.Type_TIMESTAMP:
return Timestamp()
elif dt == UUIDType:
elif dt == UUIDType():
return UUID()
elif dt == JSONType:
elif dt == JSONType():
return String()
else:
raise ScalarInvalidTypeError("Invalid type {} for scalar".format(dt))
14 changes: 6 additions & 8 deletions cloudquery/sdk/scheduler/scheduler.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
from typing import List, Generator, Any
import queue
import time
from concurrent import futures
from typing import List, Generator, Any

import structlog
from enum import Enum
from cloudquery.sdk.schema import Table, Resource

from cloudquery.sdk.message import (
SyncMessage,
SyncInsertMessage,
SyncMigrateTableMessage,
)
from concurrent import futures
from typing import Generator
from cloudquery.sdk.schema import Resource
from .table_resolver import TableResolver
import traceback

QUEUE_PER_WORKER = 100

Expand Down Expand Up @@ -192,4 +190,4 @@ def sync(
break
continue
yield message
thread.shutdown()
thread.shutdown(wait=True)
22 changes: 1 addition & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
cloudquery-plugin-pb==0.0.14
exceptiongroup==1.1.2
black==23.7.0
grpcio==1.56.2
grpcio-tools==1.56.2
iniconfig==2.0.0
Jinja2==3.1.2
MarkupSafe==2.1.3
numpy==1.25.2
packaging==23.1
pandas==2.0.3
pluggy==1.2.0
protobuf==4.23.4
pyarrow==12.0.1
pytest==7.4.0
python-dateutil==2.8.2
pytz==2023.3
six==1.16.0
structlog==23.1.0
tomli==2.0.1
tzdata==2023.3
.
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,26 @@

dependencies = [
"cloudquery-plugin-pb==0.0.14",
"pyarrow==12.0.1",
"exceptiongroup==1.1.2",
"black==23.7.0",
"grpcio==1.56.2",
"grpcio-tools==1.56.2",
"iniconfig==2.0.0",
"Jinja2==3.1.2",
"structlog==23.1.0",
"MarkupSafe==2.1.3",
"numpy==1.25.2",
"packaging==23.1",
"pandas==2.0.3",
"pluggy==1.2.0",
"protobuf==4.23.4",
"pyarrow==12.0.1",
"pytest==7.4.0",
"python-dateutil==2.8.2",
"pytz==2023.3",
"six==1.16.0",
"structlog==23.1.0",
"tomli==2.0.1",
"tzdata==2023.3",
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved all the requirements into setup.py, and changed requirements.txt to ., so that they are the same. We can change this again later, but this should ensure that the package and dev requirements are the same for now. Only thing is that we probably don't need black here

]
url = "https://github.com/cloudquery/plugin-sdk-python"

Expand Down
Empty file added tests/types/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions tests/types/json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from cloudquery.sdk.types import JSONType


def test_json_type():
j = JSONType()
# test equality
assert j == JSONType()