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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- Managed Streaming Should Handle Throttling Events Correctly
- Changed extra's name back to `aio`
- Fixed encoding error in `ingest_from_dataframe` when using csv data format.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from azure.core.tracing import SpanKind

from azure.kusto.data import KustoConnectionStringBuilder
from azure.kusto.data.exceptions import KustoApiError, KustoClosedError
from azure.kusto.data.exceptions import KustoApiError, KustoClosedError, KustoThrottlingError
from azure.kusto.data._telemetry import MonitoredActivity

from . import BlobDescriptor, FileDescriptor, IngestionProperties, StreamDescriptor
Expand Down Expand Up @@ -99,7 +99,9 @@ def ingest_from_stream(self, stream_descriptor: Union[StreamDescriptor, IO[AnySt
if error.permanent:
raise
buffered_stream.seek(0, SEEK_SET)

except KustoThrottlingError:
_ = buffered_stream.seek(0, SEEK_SET)

Comment on lines +103 to +104
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_ = buffered_stream.seek(0, SEEK_SET)
_ = buffered_stream.seek(0, SEEK_SET)

return self.queued_client.ingest_from_stream(stream_descriptor, ingestion_properties)

@distributed_trace(kind=SpanKind.CLIENT)
Expand Down Expand Up @@ -127,7 +129,9 @@ def ingest_from_blob(self, blob_descriptor: BlobDescriptor, ingestion_properties
error = ex.get_api_error()
if error.permanent:
raise

except KustoThrottlingError:
pass

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

return self.queued_client.ingest_from_blob(blob_descriptor, ingestion_properties)

def _stream_with_retries(
Expand Down
Loading