atlan-application-sdk 1.0.2__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.
@@ -151,6 +151,10 @@ class ActivitiesInterface(ABC, Generic[ActivitiesStateType]):
151
151
  )
152
152
  await self._clean_state()
153
153
  raise
154
+ except Exception as err:
155
+ logger.error(f"Error getting state: {str(err)}", exc_info=err)
156
+ await self._clean_state()
157
+ raise
154
158
 
155
159
  async def _clean_state(self):
156
160
  """Remove the state data for the current workflow.
@@ -85,7 +85,15 @@ class ObjectStore:
85
85
 
86
86
  # Extract paths based on response type
87
87
  if isinstance(file_list, list):
88
- paths = file_list
88
+ # Handle list format: strings OR Azure Blob/GCP dicts with "Name" field
89
+ paths = []
90
+ for item in file_list:
91
+ if isinstance(item, str):
92
+ paths.append(item)
93
+ elif isinstance(item, dict) and isinstance(item.get("Name"), str):
94
+ paths.append(item["Name"])
95
+ else:
96
+ logger.warning(f"Skipping invalid path entry: {item}")
89
97
  elif isinstance(file_list, dict) and "Contents" in file_list:
90
98
  paths = [item["Key"] for item in file_list["Contents"] if "Key" in item]
91
99
  elif isinstance(file_list, dict):
@@ -98,6 +106,7 @@ class ObjectStore:
98
106
  if not isinstance(path, str):
99
107
  logger.warning(f"Skipping non-string path: {path}")
100
108
  continue
109
+
101
110
  valid_list.append(
102
111
  path[path.find(prefix) :]
103
112
  if prefix and prefix in path
@@ -460,9 +469,35 @@ class ObjectStore:
460
469
  Exception: If there's an error with the Dapr binding operation.
461
470
  """
462
471
  try:
463
- with DaprClient(
464
- max_grpc_message_length=DAPR_MAX_GRPC_MESSAGE_LENGTH
465
- ) 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:
466
501
  response = client.invoke_binding(
467
502
  binding_name=store_name,
468
503
  operation=operation,
@@ -2,4 +2,4 @@
2
2
  Version information for the application_sdk package.
3
3
  """
4
4
 
5
- __version__ = "1.0.2"
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.2
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,8 +1,8 @@
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=akVgygs1oN8Lt6vnP-2pwB8oyNGN15XLpIPgkgIHleA,84
3
+ application_sdk/version.py,sha256=cCvhI08C_P1mwYdUOoxxgWbEkuguvfFnVYGhRHHF5p8,84
4
4
  application_sdk/worker.py,sha256=D3-wtfGv1DLFKi1YSaE3jTcX66eC00N6RwtBu9RkgNc,7555
5
- application_sdk/activities/__init__.py,sha256=L5WXkTwOwGtjWAlXrUJRCKGwyIyp3z8fBv8BZVCRFQI,11175
5
+ application_sdk/activities/__init__.py,sha256=9nkd4FVaAJ5Qj5bF6aeMz0--0U3Ul3uRZsN2c3iDxg4,11339
6
6
  application_sdk/activities/lock_management.py,sha256=6Wdf3jMKitoarHQP91PIJOoGFz4aaOLS_40c7n1yAOA,3902
7
7
  application_sdk/activities/.cursor/BUGBOT.md,sha256=FNykX5aMkdOhzgpiGqstOnSp9JN63iR2XP3onU4AGh8,15843
8
8
  application_sdk/activities/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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=7TZSQAoba1-2Eb-C8v9ULhba6-Ss9ym4ICjrISr8CAs,17203
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.2.dist-info/METADATA,sha256=fEbew4WYY-qIhqeREuvwZQptBYlBKLSzUqbEvxPmcmo,5913
161
- atlan_application_sdk-1.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
162
- atlan_application_sdk-1.0.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
163
- atlan_application_sdk-1.0.2.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
164
- atlan_application_sdk-1.0.2.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,,