sql-blocks 1.25.33022122__py3-none-any.whl → 1.25.33022255__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.
- sql_blocks/sql_blocks.py +11 -12
- {sql_blocks-1.25.33022122.dist-info → sql_blocks-1.25.33022255.dist-info}/METADATA +1 -1
- sql_blocks-1.25.33022255.dist-info/RECORD +7 -0
- sql_blocks-1.25.33022122.dist-info/RECORD +0 -7
- {sql_blocks-1.25.33022122.dist-info → sql_blocks-1.25.33022255.dist-info}/LICENSE +0 -0
- {sql_blocks-1.25.33022122.dist-info → sql_blocks-1.25.33022255.dist-info}/WHEEL +0 -0
- {sql_blocks-1.25.33022122.dist-info → sql_blocks-1.25.33022255.dist-info}/top_level.txt +0 -0
sql_blocks/sql_blocks.py
CHANGED
@@ -1135,7 +1135,13 @@ class CypherParser(Parser):
|
|
1135
1135
|
Count().As(token, extra_classes).add(pk_field, self.queries[-1])
|
1136
1136
|
return
|
1137
1137
|
else:
|
1138
|
-
|
1138
|
+
class_type = FUNCTION_CLASS.get(func_name)
|
1139
|
+
if not class_type:
|
1140
|
+
raise ValueError(f'Unknown function `{func_name}`.')
|
1141
|
+
if ':' in token:
|
1142
|
+
token, field_alias = token.split(':')
|
1143
|
+
class_type = class_type().As(field_alias)
|
1144
|
+
class_list = [class_type]
|
1139
1145
|
class_list += extra_classes
|
1140
1146
|
FieldList(token, class_list).add('', self.queries[-1])
|
1141
1147
|
|
@@ -1699,15 +1705,8 @@ def detect(text: str, join_queries: bool = True, format: str='') -> Select | lis
|
|
1699
1705
|
|
1700
1706
|
|
1701
1707
|
if __name__ == "__main__":
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
'[2] = R.[1]', 'JFK', '.csv'
|
1706
|
-
).join(
|
1707
|
-
'Airport(*id,name)', FLIGHT_FIELDS, format='.parquet'
|
1708
|
-
).counter(
|
1709
|
-
'stops', 0
|
1708
|
+
CAMPO_MEDIA = 'MEDIA_SALARIAL_DEPTO'
|
1709
|
+
employees = detect(
|
1710
|
+
f'Employees@department_id(avg$salary:{CAMPO_MEDIA})'
|
1710
1711
|
)
|
1711
|
-
print(
|
1712
|
-
print('-'*50)
|
1713
|
-
|
1712
|
+
print(employees)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sql_blocks
|
3
|
-
Version: 1.25.
|
3
|
+
Version: 1.25.33022255
|
4
4
|
Summary: Allows you to create objects for parts of SQL query commands. Also to combine these objects by joining them, adding or removing parts...
|
5
5
|
Home-page: https://github.com/julio-cascalles/sql_blocks
|
6
6
|
Author: Júlio Cascalles
|
@@ -0,0 +1,7 @@
|
|
1
|
+
sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
|
2
|
+
sql_blocks/sql_blocks.py,sha256=orYGCD6mnYmPZT4xzLXMy8Na_nwUdAe0HxsVPeas6LM,57510
|
3
|
+
sql_blocks-1.25.33022255.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
4
|
+
sql_blocks-1.25.33022255.dist-info/METADATA,sha256=mOP6W7LDKvEHlfrZUVooyBwYs1A9a55K9bpLQpVt2N0,19574
|
5
|
+
sql_blocks-1.25.33022255.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
sql_blocks-1.25.33022255.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
|
7
|
+
sql_blocks-1.25.33022255.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
sql_blocks/__init__.py,sha256=5ItzGCyqqa6kwY8wvF9kapyHsAiWJ7KEXCcC-OtdXKg,37
|
2
|
-
sql_blocks/sql_blocks.py,sha256=Dup1dUwejLXPa694JpegI3Ky6UnEOsxg_FOClP26qdI,57352
|
3
|
-
sql_blocks-1.25.33022122.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
4
|
-
sql_blocks-1.25.33022122.dist-info/METADATA,sha256=AknkUf3x_w302D2UiTCCwhMkCOgoP-tQ5HKjsS2pjYE,19574
|
5
|
-
sql_blocks-1.25.33022122.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
sql_blocks-1.25.33022122.dist-info/top_level.txt,sha256=57AbUvUjYNy4m1EqDaU3WHeP-uyIAfV0n8GAUp1a1YQ,11
|
7
|
-
sql_blocks-1.25.33022122.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|