Skip to content
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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

V2 ingest #544

wants to merge 33 commits into from

Conversation

mayamarom10
Copy link
Member

Added Kusto Uploader for V2 ingest

Copy link

github-actions bot commented Jun 24, 2024

Test Results

    6 files  ± 0      6 suites  ±0   20m 41s ⏱️ - 1m 10s
  295 tests + 3    269 ✅ + 3   26 💤 ±0  0 ❌ ±0 
1 770 runs  +18  1 614 ✅ +18  156 💤 ±0  0 ❌ ±0 

Results for commit e3ae039. ± Comparison against base commit 1c0d225.

♻️ This comment has been updated with latest results.

azure-kusto-data/azure/kusto/data/exceptions.py Outdated Show resolved Hide resolved
azure-kusto-ingest/azure/kusto/ingest/V2/blob_source.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
Copy link
Collaborator

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:
Copy link
Collaborator

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 ..

Copy link
Member Author

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):
Copy link
Collaborator

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

Copy link
Member Author

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")
Copy link
Collaborator

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 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants