sql-error-categorizer 0.2.2__py3-none-any.whl → 0.2.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.
@@ -448,8 +448,9 @@ class LogicalErrorDetector(BaseDetector):
448
448
  if extraneous_columns or missing_columns:
449
449
  return results # skip AS check if column count is already wrong
450
450
 
451
- expected_aliases: set[str] = set.intersection(*[set(col.name for col in sol.main_query.output.columns) for sol in self.solutions])
452
- provided_aliases: set[str] = set(col.name for col in self.query.main_query.output.columns)
451
+ # only consider columns that are actually aliased
452
+ expected_aliases: set[str] = set.intersection(*[set(col.name for col in sol.main_query.output.columns if col.name != col.real_name and not col.name.startswith('_')) for sol in self.solutions])
453
+ provided_aliases: set[str] = set(col.name for col in self.query.main_query.output.columns if col.name != col.real_name and not col.name.startswith('_'))
453
454
 
454
455
  missing_aliases = expected_aliases - provided_aliases
455
456
 
@@ -259,6 +259,10 @@ class SyntaxErrorDetector(BaseDetector):
259
259
  continue
260
260
 
261
261
  for column in select.ast.find_all(exp.Column):
262
+ # skip `table.*` syntax, we only want to check actual column references
263
+ if isinstance(column.this, exp.Star):
264
+ continue
265
+
262
266
  column_name = util.ast.column.get_name(column)
263
267
  table_name = util.ast.column.get_table(column)
264
268
 
@@ -403,6 +407,10 @@ class SyntaxErrorDetector(BaseDetector):
403
407
  continue
404
408
 
405
409
  for column in select.ast.find_all(exp.Column):
410
+ # skip `table.*` syntax, we only want to check actual column references
411
+ if isinstance(column.this, exp.Star):
412
+ continue
413
+
406
414
  column = deepcopy(column) # avoid modifying the original AST until we are sure we want to apply the correction
407
415
  column_str = column.sql()
408
416
  column_name = util.ast.column.get_name(column)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sql_error_categorizer
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: This project analyses SQL statements and labels possible errors or complications.
5
5
  Project-URL: Repository, https://github.com/DavidePonzini/sql_error_categorizer
6
6
  Project-URL: Documentation, https://sql-error-categorizer.readthedocs.io/en/latest/index.html
@@ -17,7 +17,7 @@ Requires-Dist: pyyaml
17
17
  Requires-Dist: sql-error-taxonomy
18
18
  Requires-Dist: sqlglot
19
19
  Requires-Dist: sqlparse
20
- Requires-Dist: sqlscope
20
+ Requires-Dist: sqlscope>=1.0.15
21
21
  Requires-Dist: z3-solver
22
22
  Description-Content-Type: text/markdown
23
23
 
@@ -2,10 +2,10 @@ sql_error_categorizer/__init__.py,sha256=L4wrfeTr84RU8hDZnmu0_ae0whPfHqNKYsO-wvk
2
2
  sql_error_categorizer/detectors/__init__.py,sha256=Ph2qu8nvrXcEXStp6fpgXcMESeXUS9UckX878sFym_g,3680
3
3
  sql_error_categorizer/detectors/base.py,sha256=8KbTE0R8XMU_u9MNwYCOoA-ie1ZIW3GbLQuLQL_mfAQ,1360
4
4
  sql_error_categorizer/detectors/complications.py,sha256=rDKN083o4qq9ErIBqFecTf8YkrkAS5rC51wGwJJV8es,19756
5
- sql_error_categorizer/detectors/logical.py,sha256=uAbIhls7dfLvCyPawRWeeG_dN2c4czCFteIeiLB3Qis,31815
5
+ sql_error_categorizer/detectors/logical.py,sha256=a9RipA-5MTMfxlOkbQ0L532LmicxaoKquHD6SA7D578,31997
6
6
  sql_error_categorizer/detectors/semantic.py,sha256=h4j3AZI2HEMxXa3BOJ1fWDO6K4BiQ8dHKNcO-tRIHwU,19671
7
- sql_error_categorizer/detectors/syntax.py,sha256=-xGlGr6d4PiQLC75tWVBVxy-8KyGyUKbHGkMrpvpdoM,54629
8
- sql_error_categorizer-0.2.2.dist-info/METADATA,sha256=LD874gbPga_ftKe63D75z3fRGu6tWhn5NsrrLwXCFE8,20157
9
- sql_error_categorizer-0.2.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
10
- sql_error_categorizer-0.2.2.dist-info/licenses/LICENSE,sha256=6uZykGj9Y_5PgqXoMMwaGqoZFXVBpzCmitv8Dek1XtQ,1091
11
- sql_error_categorizer-0.2.2.dist-info/RECORD,,
7
+ sql_error_categorizer/detectors/syntax.py,sha256=x2GacbGf5-VTb61sI0TUgroLOc5_7kpiC7Xa7hX6pBU,54973
8
+ sql_error_categorizer-0.2.4.dist-info/METADATA,sha256=xZKArv6sMVbCP1otW_nXwKvzMxeVt2ZO-Wt3V-s8Xho,20165
9
+ sql_error_categorizer-0.2.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
10
+ sql_error_categorizer-0.2.4.dist-info/licenses/LICENSE,sha256=6uZykGj9Y_5PgqXoMMwaGqoZFXVBpzCmitv8Dek1XtQ,1091
11
+ sql_error_categorizer-0.2.4.dist-info/RECORD,,