aiteamutils 0.2.131__py3-none-any.whl → 0.2.132__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.
aiteamutils/database.py CHANGED
@@ -7,7 +7,8 @@ from typing import (
7
7
  Dict,
8
8
  List,
9
9
  Optional,
10
- AsyncGenerator
10
+ AsyncGenerator,
11
+ Union
11
12
  )
12
13
  from sqlalchemy.ext.asyncio import AsyncSession
13
14
  from sqlalchemy import select, and_, or_
@@ -175,6 +176,12 @@ def process_response(
175
176
  field_info = response_model.model_fields[relationship.key]
176
177
  nested_response_model = field_info.annotation
177
178
  print(f"[DEBUG] Found nested response model for {relationship.key}: {nested_response_model}")
179
+
180
+ # Optional[ProjectResponse] 같은 경우 실제 모델 추출
181
+ if hasattr(nested_response_model, '__origin__') and nested_response_model.__origin__ is Union:
182
+ print(f"[DEBUG] Extracting actual model from Union type: {nested_response_model.__args__}")
183
+ nested_response_model = next((t for t in nested_response_model.__args__ if hasattr(t, 'model_fields')), None)
184
+ print(f"[DEBUG] Extracted model: {nested_response_model}")
178
185
 
179
186
  if value is not None:
180
187
  if isinstance(value, list):
@@ -183,12 +190,15 @@ def process_response(
183
190
  for item in value
184
191
  ]
185
192
  else:
193
+ print(f"[DEBUG] Processing single value with model: {nested_response_model}")
186
194
  result[relationship.key] = process_response(value, nested_response_model)
195
+ print(f"[DEBUG] After processing relationship {relationship.key}: {result[relationship.key]}")
187
196
  else:
188
197
  result[relationship.key] = None
189
- print(f"[DEBUG] After processing relationship {relationship.key}: {result[relationship.key]}")
190
198
  except Exception as e:
191
199
  print(f"[DEBUG] Error processing relationship {relationship.key}: {str(e)}")
200
+ import traceback
201
+ print(f"[DEBUG] Full traceback: {traceback.format_exc()}")
192
202
  result[relationship.key] = None
193
203
 
194
204
  print(f"\n[DEBUG] Before response model processing: {result}")
@@ -203,9 +213,14 @@ def process_response(
203
213
  print(f"[DEBUG] Removing key not in response model: {key}")
204
214
  result.pop(key)
205
215
  # 모델 검증 및 업데이트
206
- validated_result = response_model(**result).model_dump()
207
- print(f"[DEBUG] After validation: {validated_result}")
208
- result.update(validated_result)
216
+ try:
217
+ validated_result = response_model(**result).model_dump()
218
+ print(f"[DEBUG] After validation: {validated_result}")
219
+ result.update(validated_result)
220
+ except Exception as e:
221
+ print(f"[DEBUG] Error during validation: {str(e)}")
222
+ import traceback
223
+ print(f"[DEBUG] Full validation traceback: {traceback.format_exc()}")
209
224
 
210
225
  print(f"[DEBUG] Final result: {result}")
211
226
  return result
aiteamutils/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """버전 정보"""
2
- __version__ = "0.2.131"
2
+ __version__ = "0.2.132"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.131
3
+ Version: 0.2.132
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -4,12 +4,12 @@ aiteamutils/base_repository.py,sha256=vzBw3g3jCJetTDblZvZenEGXk89Qu_65_02C7QTcf8
4
4
  aiteamutils/base_service.py,sha256=nHikjwGp29QrQPr2W8Ye9sKxmVS_8prRG3Nu42TU1Ms,10670
5
5
  aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
6
6
  aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
7
- aiteamutils/database.py,sha256=uurxHBsAPM0LgPNsolN6jyvSAog0bA5OjdzoRxT8qaI,21070
7
+ aiteamutils/database.py,sha256=XwgienPxjGr-PXdfYg6RDOLinNywNk1enYWegB-86uQ,22042
8
8
  aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
9
9
  aiteamutils/exceptions.py,sha256=pgf3ersezObyl17wAO3I2fb8m9t2OzWDX1mSjwAWm2Y,16035
10
10
  aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
11
11
  aiteamutils/validators.py,sha256=msOrha36xWsapm4VAh63YmFq1GVyC9tzZcjXYFCEZ_g,11949
12
- aiteamutils/version.py,sha256=C-W4DcR9CDTfhqYUftv2T9XZS_FvRrzHTFjRmRf5eko,43
13
- aiteamutils-0.2.131.dist-info/METADATA,sha256=QferQh8AsHLp7sUc5rNKSzWwQl7r5R-5eMvdg-Weg-U,1719
14
- aiteamutils-0.2.131.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- aiteamutils-0.2.131.dist-info/RECORD,,
12
+ aiteamutils/version.py,sha256=j19bkYR2Nt5EhQU7qr9qZbsT-v5l9WzURNYBBdlPff8,43
13
+ aiteamutils-0.2.132.dist-info/METADATA,sha256=R7s9jHRbAWS6PJXas8sWCOuUGIqIXIpjLhe5QEOpE7s,1719
14
+ aiteamutils-0.2.132.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ aiteamutils-0.2.132.dist-info/RECORD,,