-
Notifications
You must be signed in to change notification settings - Fork 107
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
V2 ingest #544
base: master
Are you sure you want to change the base?
V2 ingest #544
Conversation
azure-kusto-ingest/azure/kusto/ingest/V2/kusto_storage_uploader.py
Outdated
Show resolved
Hide resolved
azure-kusto-ingest/azure/kusto/ingest/V2/kusto_storage_uploader.py
Outdated
Show resolved
Hide resolved
azure-kusto-ingest/azure/kusto/ingest/V2/kusto_storage_uploader.py
Outdated
Show resolved
Hide resolved
if local_stream is None or len(local_stream) == 0: | ||
raise KustoUploadError(local_source.name) | ||
blob_name = local_source.name + "_" + str(local_source.source_id) + "_" + str(local_source.compression_type.name) | ||
blob_uri = self.upload_blob(blob_name, local_stream, getattr(local_source, "size", None), local_source.source_id).path |
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.
Lets look together what we do in C# ..
elif path.lower().endswith(".gz"): | ||
self.compression_type = CompressionType.GZip | ||
|
||
def data(self) -> bytes: |
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.
Please check what happens if this is called twice ..
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.
Doesn't seem to cause a problem
return (self.compression_type == CompressionType.Uncompressed) and self.format.compressible | ||
|
||
@abstractmethod | ||
def data(self): |
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.
Add a return type - and then you can see they return a different type
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.
Updated them all to match: def data(self) -> IO[AnyStr]:
def test_upload_source_is_gzip_file(self): | ||
file_source = FileSource("azure-kusto-ingest/tests/input/dataset.csv.gz", DataFormat.CSV) | ||
blob_source = self.uploader.upload_local_source(file_source) | ||
assert blob_source.url.__contains__("dataset.csv") |
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.
Let's talk aobut how to test that a stream can be uploaded with retries ..
Added Kusto Uploader for V2 ingest