findly.unified-reporting-sdk 0.6.20__tar.gz → 0.6.22__tar.gz

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.
Files changed (34) hide show
  1. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/PKG-INFO +1 -1
  2. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/common/where_string_comparison.py +30 -2
  3. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/pyproject.toml +1 -1
  4. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/LICENSE +0 -0
  5. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/README.md +0 -0
  6. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/__init__.py +0 -0
  7. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/__init__.py +0 -0
  8. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/__init__.py +0 -0
  9. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/common/__init__.py +0 -0
  10. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/common/common_parser.py +0 -0
  11. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/common/date_range_helper.py +0 -0
  12. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/common/reports_client.py +0 -0
  13. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/__init__.py +0 -0
  14. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/fb_ads_client.py +0 -0
  15. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/fb_ads_query_args_parser.py +0 -0
  16. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/metadata/action_breakdowns.csv +0 -0
  17. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/metadata/breakdowns.csv +0 -0
  18. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/metadata/dimensions.jsonl +0 -0
  19. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/metadata/fields.csv +0 -0
  20. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/fb_ads/metadata/metrics.jsonl +0 -0
  21. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/ga4/__init__.py +0 -0
  22. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/ga4/ga4_client.py +0 -0
  23. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/ga4/ga4_query_args_parser.py +0 -0
  24. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/ga4/metadata/dimensions.jsonl +0 -0
  25. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/gsc/__init__.py +0 -0
  26. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/gsc/gsc_client.py +0 -0
  27. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/data_sources/gsc/gsc_service.py +0 -0
  28. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/protos/.gitignore +0 -0
  29. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/protos/__init__.py +0 -0
  30. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/protos/findly_semantic_layer_pb2.py +0 -0
  31. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/protos/findly_semantic_layer_pb2.pyi +0 -0
  32. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/urs.py +0 -0
  33. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/util/__init__.py +0 -0
  34. {findly_unified_reporting_sdk-0.6.20 → findly_unified_reporting_sdk-0.6.22}/findly/unified_reporting_sdk/util/create_numeric_string_series.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: findly.unified-reporting-sdk
3
- Version: 0.6.20
3
+ Version: 0.6.22
4
4
  Summary:
5
5
  License: GPL-3.0-only
6
6
  Requires-Python: >=3.9,<4.0
@@ -31,6 +31,7 @@ def parse_where_columns_from_sql_query(
31
31
  {
32
32
  "msg": "empty_or_missing_where_clause",
33
33
  "where_clause": where_clause_str,
34
+ "dialect": dialect,
34
35
  "sql_query": sql_query,
35
36
  }
36
37
  )
@@ -42,6 +43,7 @@ def parse_where_columns_from_sql_query(
42
43
  {
43
44
  "msg": "where_clause_contains_no_conditions",
44
45
  "where_clause": where_clause_str,
46
+ "dialect": dialect,
45
47
  "sql_query": sql_query,
46
48
  }
47
49
  )
@@ -58,6 +60,7 @@ def parse_where_columns_from_sql_query(
58
60
  {
59
61
  "msg": "parse_where_column_condition_no_where_clause",
60
62
  "where_clause": where_clause_str,
63
+ "dialect": dialect,
61
64
  "sql_query": sql_query,
62
65
  }
63
66
  )
@@ -79,7 +82,7 @@ def parse_where_columns_from_sql_query(
79
82
  pass
80
83
 
81
84
  column_operator_used_for_where_clause = condition.key
82
- if column_operator_used_for_where_clause == "in":
85
+ if column_operator_used_for_where_clause.lower() == "in":
83
86
  # expression list cause this is an IN operator, so we get back
84
87
  # an array, lets handle that by iterating over the expressions
85
88
  for expression in condition.expressions:
@@ -91,7 +94,7 @@ def parse_where_columns_from_sql_query(
91
94
  is_not_condition=not_condition,
92
95
  )
93
96
  )
94
- elif column_operator_used_for_where_clause == "between":
97
+ elif column_operator_used_for_where_clause.lower() == "between":
95
98
  where_clause_values.append(
96
99
  WhereClauseInformation(
97
100
  column_name=condition.args["this"].sql(),
@@ -100,6 +103,19 @@ def parse_where_columns_from_sql_query(
100
103
  is_not_condition=not_condition,
101
104
  )
102
105
  )
106
+ # Handle LIKE operator specifically
107
+ elif column_operator_used_for_where_clause.lower() == "like":
108
+ # Ensure correct handling of LIKE patterns, including special characters
109
+ column_name = condition.this.sql()
110
+ column_value = condition.expression.sql()
111
+ where_clause_values.append(
112
+ WhereClauseInformation(
113
+ column_name=column_name,
114
+ column_operator="like",
115
+ column_value=column_value,
116
+ is_not_condition=not_condition,
117
+ )
118
+ )
103
119
  else:
104
120
  # We fail on parsing things like:
105
121
  # CAST(A as B)
@@ -122,6 +138,7 @@ def parse_where_columns_from_sql_query(
122
138
  "condition": condition.this.sql(),
123
139
  "where_clause": where_clause_str,
124
140
  "sql_query": sql_query,
141
+ "dialect": dialect,
125
142
  "error": str(e),
126
143
  }
127
144
  )
@@ -130,6 +147,7 @@ def parse_where_columns_from_sql_query(
130
147
  "msg": "parse_where_column_condition_values",
131
148
  "where_clause": where_clause_str,
132
149
  "sql_query": sql_query,
150
+ "dialect": dialect,
133
151
  "where_clause_values": [
134
152
  dataclasses.asdict(value) for value in where_clause_values
135
153
  ],
@@ -142,6 +160,7 @@ def parse_where_columns_from_sql_query(
142
160
  "msg": "error_parse_where_column_condition",
143
161
  "where_clause": where_clause_str,
144
162
  "sql_query": sql_query,
163
+ "dialect": dialect,
145
164
  "error": str(e),
146
165
  }
147
166
  )
@@ -169,3 +188,12 @@ def parse_where_column_condition(
169
188
  dialect=dialect,
170
189
  where_clause_str=where_clause_str,
171
190
  )
191
+
192
+
193
+ # main method to test it
194
+ if __name__ == "__main__":
195
+ # ERROR:findly.unified_reporting_sdk.data_sources.common.where_string_comparison:{'msg': 'error_parse_where_column_condition', 'where_clause': "WHERE LOWER(cargo) LIKE LOWER('%crude%') AND WHERE LOWER(imo__ais_destination_formatted) LIKE LOWER(%rotterdam%) ", 'sql_query': "select * from table WHERE LOWER(cargo) LIKE LOWER('%crude%') AND WHERE LOWER(imo__ais_destination_formatted) LIKE LOWER(%rotterdam%) ", 'error': "Required keyword: 'expression' missing for <class 'sqlglot.expressions.And'>. Line 1, Col: 70.\n select * from table WHERE LOWER(cargo) LIKE LOWER('%crude%') AND \x1b[4mWHERE\x1b[0m LOWER(imo__ais_destination_formatted) LIKE LOWER(%rotterdam%) "}
196
+ # i want to test this case above
197
+ where_clause_str = "WHERE LOWER(cargo) LIKE LOWER('%crude%') AND WHERE LOWER(imo__ais_destination_formatted) LIKE LOWER(%rotterdam%) "
198
+ dialect = "bigquery"
199
+ print(parse_where_column_condition(where_clause_str, dialect))
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "findly.unified-reporting-sdk"
3
- version = "0.6.20"
3
+ version = "0.6.22"
4
4
  license = "GPL-3.0-only"
5
5
  description = ""
6
6
  authors = []