jararaca 0.3.12a17__py3-none-any.whl → 0.3.12a18__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.

Potentially problematic release.


This version of jararaca might be problematic. Click here for more details.

@@ -114,9 +114,14 @@ async def providing_new_session(
114
114
  current_session.bind,
115
115
  ) as new_session, new_session.begin() as new_tx:
116
116
  with providing_session(new_session, new_tx, connection_name):
117
- yield new_session
118
- if new_tx.is_active:
119
- await new_tx.commit()
117
+ try:
118
+ yield new_session
119
+ if new_tx.is_active:
120
+ await new_tx.commit()
121
+ except Exception:
122
+ if new_tx.is_active:
123
+ await new_tx.rollback()
124
+ raise
120
125
 
121
126
 
122
127
  def use_session(connection_name: str | None = None) -> AsyncSession:
@@ -1067,26 +1067,37 @@ def extract_parameters(
1067
1067
  )
1068
1068
  else:
1069
1069
  mapped_types.add(annotated_type)
1070
- # For default parameters (treated as query), use Input suffix if it's a split model
1071
- context_suffix = (
1072
- "Input"
1073
- if (
1074
- inspect.isclass(annotated_type)
1075
- and hasattr(annotated_type, "__dict__")
1076
- and SplitInputOutput.is_split_model(annotated_type)
1070
+ # Special handling for UploadFile - should go to body, not query
1071
+ if annotated_type == UploadFile:
1072
+ parameters_list.append(
1073
+ HttpParemeterSpec(
1074
+ type_="body",
1075
+ name=parameter_name,
1076
+ required=True,
1077
+ argument_type_str=get_field_type_for_ts(annotated_type),
1078
+ )
1077
1079
  )
1078
- else ""
1079
- )
1080
- parameters_list.append(
1081
- HttpParemeterSpec(
1082
- type_="query",
1083
- name=parameter_name,
1084
- required=True,
1085
- argument_type_str=get_field_type_for_ts(
1086
- annotated_type, context_suffix
1087
- ),
1080
+ else:
1081
+ # For default parameters (treated as query), use Input suffix if it's a split model
1082
+ context_suffix = (
1083
+ "Input"
1084
+ if (
1085
+ inspect.isclass(annotated_type)
1086
+ and hasattr(annotated_type, "__dict__")
1087
+ and SplitInputOutput.is_split_model(annotated_type)
1088
+ )
1089
+ else ""
1090
+ )
1091
+ parameters_list.append(
1092
+ HttpParemeterSpec(
1093
+ type_="query",
1094
+ name=parameter_name,
1095
+ required=True,
1096
+ argument_type_str=get_field_type_for_ts(
1097
+ annotated_type, context_suffix
1098
+ ),
1099
+ )
1088
1100
  )
1089
- )
1090
1101
 
1091
1102
  elif inspect.isclass(parameter_type) and issubclass(
1092
1103
  parameter_type, BaseModel
@@ -1106,6 +1117,17 @@ def extract_parameters(
1106
1117
  ),
1107
1118
  )
1108
1119
  )
1120
+ elif parameter_type == UploadFile:
1121
+ # UploadFile should always go to body, not query parameters
1122
+ mapped_types.add(parameter_type)
1123
+ parameters_list.append(
1124
+ HttpParemeterSpec(
1125
+ type_="body",
1126
+ name=parameter_name,
1127
+ required=True,
1128
+ argument_type_str=get_field_type_for_ts(parameter_type),
1129
+ )
1130
+ )
1109
1131
  elif (
1110
1132
  # Match both simple parameters {param} and parameters with converters {param:converter}
1111
1133
  re.search(f"{{{parameter_name}(:.*?)?}}", controller.path) is not None
@@ -1134,26 +1156,37 @@ def extract_parameters(
1134
1156
  )
1135
1157
  else:
1136
1158
  mapped_types.add(parameter_type)
1137
- # For default parameters (treated as query), use Input suffix if it's a split model
1138
- context_suffix = (
1139
- "Input"
1140
- if (
1141
- inspect.isclass(parameter_type)
1142
- and hasattr(parameter_type, "__dict__")
1143
- and SplitInputOutput.is_split_model(parameter_type)
1159
+ # Special handling for UploadFile - should go to body, not query
1160
+ if parameter_type == UploadFile:
1161
+ parameters_list.append(
1162
+ HttpParemeterSpec(
1163
+ type_="body",
1164
+ name=parameter_name,
1165
+ required=True,
1166
+ argument_type_str=get_field_type_for_ts(parameter_type),
1167
+ )
1144
1168
  )
1145
- else ""
1146
- )
1147
- parameters_list.append(
1148
- HttpParemeterSpec(
1149
- type_="query",
1150
- name=parameter_name,
1151
- required=True,
1152
- argument_type_str=get_field_type_for_ts(
1153
- parameter_type, context_suffix
1154
- ),
1169
+ else:
1170
+ # For default parameters (treated as query), use Input suffix if it's a split model
1171
+ context_suffix = (
1172
+ "Input"
1173
+ if (
1174
+ inspect.isclass(parameter_type)
1175
+ and hasattr(parameter_type, "__dict__")
1176
+ and SplitInputOutput.is_split_model(parameter_type)
1177
+ )
1178
+ else ""
1179
+ )
1180
+ parameters_list.append(
1181
+ HttpParemeterSpec(
1182
+ type_="query",
1183
+ name=parameter_name,
1184
+ required=True,
1185
+ argument_type_str=get_field_type_for_ts(
1186
+ parameter_type, context_suffix
1187
+ ),
1188
+ )
1155
1189
  )
1156
- )
1157
1190
 
1158
1191
  if inspect.isclass(parameter_type) and not is_primitive(parameter_type):
1159
1192
  signature = inspect.signature(parameter_type)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jararaca
3
- Version: 0.3.12a17
3
+ Version: 0.3.12a18
4
4
  Summary: A simple and fast API framework for Python
5
5
  Home-page: https://github.com/LuscasLeo/jararaca
6
6
  Author: Lucas S
@@ -1,6 +1,6 @@
1
1
  LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
2
2
  README.md,sha256=2qMM__t_MoLKZr4IY9tXjo-Jn6LKjuHMb1qbyXpgL08,3401
3
- pyproject.toml,sha256=stDeBAKKaDdBk5oL2gpGAiJLpPeIrDN16gnoXjeZmlE,2041
3
+ pyproject.toml,sha256=aj3QfPDz-158WddZDVdzbZgEm4SRalAyvU5X0-FpkTU,2041
4
4
  jararaca/__init__.py,sha256=vK3zyIVLckwZgj1FPX6jzSbzaSWmSy3wQ2KMwmpJnmg,22046
5
5
  jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
6
6
  jararaca/broker_backend/__init__.py,sha256=GzEIuHR1xzgCJD4FE3harNjoaYzxHMHoEL0_clUaC-k,3528
@@ -32,7 +32,7 @@ jararaca/observability/providers/otel.py,sha256=8N1F32W43t7c8cwmtTh6Yz9b7HyfGFSR
32
32
  jararaca/persistence/base.py,sha256=xnGUbsLNz3gO-9iJt-Sn5NY13Yc9-misP8wLwQuGGoM,1024
33
33
  jararaca/persistence/exports.py,sha256=Ghx4yoFaB4QVTb9WxrFYgmcSATXMNvrOvT8ybPNKXCA,62
34
34
  jararaca/persistence/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=kHI1rb71o3Ug3JzkQ0RQ2uqJuENsIRgDF69MX7H65lk,6760
35
+ jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=-YDKDicaocEz71fbt1X1S33KJBwqMYZG-4igNylbh9A,6922
36
36
  jararaca/persistence/interceptors/constants.py,sha256=o8g5RxDX9dSSnM9eXYlTJalGPfWxYm6-CAA8-FooUzE,36
37
37
  jararaca/persistence/interceptors/decorators.py,sha256=p37r9ux5w_bvn8xPNPhScl3fjCc2enqTR0cJYLxMsrI,1627
38
38
  jararaca/persistence/session.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -70,12 +70,12 @@ jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaN
70
70
  jararaca/tools/app_config/interceptor.py,sha256=HV8h4AxqUc_ACs5do4BSVlyxlRXzx7HqJtoVO9tfRnQ,2611
71
71
  jararaca/tools/typescript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
72
  jararaca/tools/typescript/decorators.py,sha256=y1zBq8mBZ8CBXlZ0nKy2RyIgCvP9kp4elACbaC6dptQ,2946
73
- jararaca/tools/typescript/interface_parser.py,sha256=OMvz4vcsKD0eYPwH1hd3PJpLP2Bc_Ex0CefIhsJArf4,47306
73
+ jararaca/tools/typescript/interface_parser.py,sha256=KSJgJqhZS243L5d005Ph_f-RiZP37rgeF0Ql6iN856w,49016
74
74
  jararaca/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  jararaca/utils/rabbitmq_utils.py,sha256=ytdAFUyv-OBkaVnxezuJaJoLrmN7giZgtKeet_IsMBs,10918
76
76
  jararaca/utils/retry.py,sha256=DzPX_fXUvTqej6BQ8Mt2dvLo9nNlTBm7Kx2pFZ26P2Q,4668
77
- jararaca-0.3.12a17.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
78
- jararaca-0.3.12a17.dist-info/METADATA,sha256=lwNzy_Aycpsghy1xAsRkSIqz15GWEuCqyu_gNFC39Oc,4996
79
- jararaca-0.3.12a17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
80
- jararaca-0.3.12a17.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
81
- jararaca-0.3.12a17.dist-info/RECORD,,
77
+ jararaca-0.3.12a18.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
78
+ jararaca-0.3.12a18.dist-info/METADATA,sha256=uDHK7-0B144S_kuJ57BELyRoJDANDRe-3Tib4N4wxXY,4996
79
+ jararaca-0.3.12a18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
80
+ jararaca-0.3.12a18.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
81
+ jararaca-0.3.12a18.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "jararaca"
3
- version = "0.3.12a17"
3
+ version = "0.3.12a18"
4
4
  description = "A simple and fast API framework for Python"
5
5
  authors = ["Lucas S <me@luscasleo.dev>"]
6
6
  readme = "README.md"