atlan-application-sdk 1.0.3__py3-none-any.whl → 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -469,9 +469,35 @@ class ObjectStore:
469
469
  Exception: If there's an error with the Dapr binding operation.
470
470
  """
471
471
  try:
472
- with DaprClient(
473
- max_grpc_message_length=DAPR_MAX_GRPC_MESSAGE_LENGTH
474
- ) as client:
472
+ # Calculate data size (handle both bytes and str)
473
+ if isinstance(data, bytes):
474
+ data_size = len(data)
475
+ elif isinstance(data, str):
476
+ data_size = len(data.encode("utf-8"))
477
+ else:
478
+ data_size = 0
479
+
480
+ # Check if data size exceeds DAPR limit and log warning
481
+ if data_size > DAPR_MAX_GRPC_MESSAGE_LENGTH:
482
+ # gRPC adds overhead (headers, metadata, etc.) to messages
483
+ # Add a buffer of 5% or at least 1KB to account for this overhead
484
+ grpc_overhead_buffer = max(int(data_size * 0.05), 1024)
485
+ required_max_length = data_size + grpc_overhead_buffer
486
+ logger.warning(
487
+ f"Data size ({data_size:,} bytes / {data_size / (1024 * 1024):.2f}MB) "
488
+ f"exceeds DAPR_MAX_GRPC_MESSAGE_LENGTH ({DAPR_MAX_GRPC_MESSAGE_LENGTH:,} bytes / "
489
+ f"{DAPR_MAX_GRPC_MESSAGE_LENGTH / (1024 * 1024):.2f}MB). "
490
+ f"Increasing max_grpc_message_length to {required_max_length:,} bytes "
491
+ f"(data size + {grpc_overhead_buffer:,} bytes overhead buffer). "
492
+ f"This may cause issues with Dapr gRPC communication."
493
+ )
494
+ # Set max_grpc_message_length to accommodate the data size plus gRPC overhead
495
+ max_message_length = required_max_length
496
+ else:
497
+ # Data is within limit, use default DAPR limit
498
+ max_message_length = DAPR_MAX_GRPC_MESSAGE_LENGTH
499
+
500
+ with DaprClient(max_grpc_message_length=max_message_length) as client:
475
501
  response = client.invoke_binding(
476
502
  binding_name=store_name,
477
503
  operation=operation,
@@ -2,4 +2,4 @@
2
2
  Version information for the application_sdk package.
3
3
  """
4
4
 
5
- __version__ = "1.0.3"
5
+ __version__ = "1.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atlan-application-sdk
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Atlan Application SDK is a Python library for developing applications on the Atlan Platform
5
5
  Project-URL: Repository, https://github.com/atlanhq/application-sdk
6
6
  Project-URL: Documentation, https://github.com/atlanhq/application-sdk/README.md
@@ -1,6 +1,6 @@
1
1
  application_sdk/__init__.py,sha256=2e2mvmLJ5dxmJGPELtb33xwP-j6JMdoIuqKycEn7hjg,151
2
2
  application_sdk/constants.py,sha256=S3I_WUGFbmAPH5GTtoTKD5rxILGevkZ219zhctLQles,11568
3
- application_sdk/version.py,sha256=CRNCKWz-am2hAz_MLElN2Zj7G_IhrNsZx4EtpAxsavI,84
3
+ application_sdk/version.py,sha256=cCvhI08C_P1mwYdUOoxxgWbEkuguvfFnVYGhRHHF5p8,84
4
4
  application_sdk/worker.py,sha256=D3-wtfGv1DLFKi1YSaE3jTcX66eC00N6RwtBu9RkgNc,7555
5
5
  application_sdk/activities/__init__.py,sha256=9nkd4FVaAJ5Qj5bF6aeMz0--0U3Ul3uRZsN2c3iDxg4,11339
6
6
  application_sdk/activities/lock_management.py,sha256=6Wdf3jMKitoarHQP91PIJOoGFz4aaOLS_40c7n1yAOA,3902
@@ -97,7 +97,7 @@ application_sdk/server/mcp/server.py,sha256=HG8tFmcc-f9Wj3vZzs2oRoNJzN1s5hwjnKyk
97
97
  application_sdk/services/__init__.py,sha256=H-5HZEPdr53MUfAggyHqHhRXDRLZFZsxvJgWbr257Ds,465
98
98
  application_sdk/services/atlan_storage.py,sha256=TKzXxu0yXeUcmZehwp8PcnQTC4A9w9RlZ0Fl-Xp1bLE,8509
99
99
  application_sdk/services/eventstore.py,sha256=X03JzodKByXh8w8nOl658rnnZfMFTj0IkmiLVbd6IN8,6729
100
- application_sdk/services/objectstore.py,sha256=Xvm4y8SZN5MYIdUL0-vPhW1EUnlVYgwp9XESrnXzgF8,17656
100
+ application_sdk/services/objectstore.py,sha256=2fMrVuXsPK04CmbAnHX-hicBDSgW_zEMJyu2v8XEjLg,19200
101
101
  application_sdk/services/secretstore.py,sha256=Jd2gYyBcF31x8Hs8d5J93SWBXBdt6ULGvSk-Gfxb8Dw,19072
102
102
  application_sdk/services/statestore.py,sha256=3-afiM3Vsoe1XDYRokdGTB5I5CwOKyieuX5RwIZf77o,9413
103
103
  application_sdk/test_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -157,8 +157,8 @@ application_sdk/workflows/metadata_extraction/__init__.py,sha256=jHUe_ZBQ66jx8bg
157
157
  application_sdk/workflows/metadata_extraction/sql.py,sha256=6ZaVt84n-8U2ZvR9GR7uIJKv5v8CuyQjhlnoRJvDszc,12435
158
158
  application_sdk/workflows/query_extraction/__init__.py,sha256=n066_CX5RpJz6DIxGMkKS3eGSRg03ilaCtsqfJWQb7Q,117
159
159
  application_sdk/workflows/query_extraction/sql.py,sha256=kT_JQkLCRZ44ZpaC4QvPL6DxnRIIVh8gYHLqRbMI-hA,4826
160
- atlan_application_sdk-1.0.3.dist-info/METADATA,sha256=lP5LvhsVgUCwD-AJCDZgGoye3Sk7j4Z1sQuakUDCLQk,5913
161
- atlan_application_sdk-1.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
162
- atlan_application_sdk-1.0.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
163
- atlan_application_sdk-1.0.3.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
164
- atlan_application_sdk-1.0.3.dist-info/RECORD,,
160
+ atlan_application_sdk-1.0.4.dist-info/METADATA,sha256=aVhhJBCcV4bD4zE-zpKTZtAT4jPZN4I2Zj0EnanKlQY,5913
161
+ atlan_application_sdk-1.0.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
162
+ atlan_application_sdk-1.0.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
163
+ atlan_application_sdk-1.0.4.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
164
+ atlan_application_sdk-1.0.4.dist-info/RECORD,,