@jacobknightley/fabric-format 0.0.8 → 0.0.9

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.
@@ -42,8 +42,16 @@ export declare const RUFF_WASM_CONFIG: {
42
42
  * These would incorrectly flag code that's used in other cells.
43
43
  * - Import-adding rules (RUF017, SIM105, PLR1722, PTH*)
44
44
  * These would add imports without knowing if they're already imported elsewhere.
45
+ * - PySpark incompatible rules (E712 true-false-comparison)
46
+ * E712 transforms Column boolean comparisons (e.g., `col != True` -> `not col`)
47
+ * which breaks PySpark's operator overloading. See regression tests for details.
45
48
  *
46
49
  * All included rules perform in-cell syntactic transformations only.
50
+ *
51
+ * PySpark Compatibility Note:
52
+ * Other rules like SIM210/211 (bool() coercion) and SIM220/221 (logical simplification)
53
+ * theoretically could affect Column objects, but either don't have auto-fixes or don't
54
+ * trigger on PySpark patterns in practice. E712 is the only rule known to cause issues.
47
55
  */
48
56
  export declare const SAFE_LINT_RULES: string[];
49
57
  /** Ruff WASM lint config for safe auto-fixes */
@@ -38,8 +38,16 @@ export const RUFF_WASM_CONFIG = {
38
38
  * These would incorrectly flag code that's used in other cells.
39
39
  * - Import-adding rules (RUF017, SIM105, PLR1722, PTH*)
40
40
  * These would add imports without knowing if they're already imported elsewhere.
41
+ * - PySpark incompatible rules (E712 true-false-comparison)
42
+ * E712 transforms Column boolean comparisons (e.g., `col != True` -> `not col`)
43
+ * which breaks PySpark's operator overloading. See regression tests for details.
41
44
  *
42
45
  * All included rules perform in-cell syntactic transformations only.
46
+ *
47
+ * PySpark Compatibility Note:
48
+ * Other rules like SIM210/211 (bool() coercion) and SIM220/221 (logical simplification)
49
+ * theoretically could affect Column objects, but either don't have auto-fixes or don't
50
+ * trigger on PySpark patterns in practice. E712 is the only rule known to cause issues.
43
51
  */
44
52
  export const SAFE_LINT_RULES = [
45
53
  // I - isort (import sorting within cell)
@@ -105,7 +113,11 @@ export const SAFE_LINT_RULES = [
105
113
  'E401', // multiple-imports-on-one-line
106
114
  'E703', // useless-semicolon
107
115
  'E711', // none-comparison
108
- 'E712', // true-false-comparison
116
+ // NOTE: E712 (true-false-comparison) excluded - causes PySpark incompatibility.
117
+ // Transforms `F.col("Active") != True` to `not F.col("Active")` and
118
+ // `F.col("status") == False` to `not F.col("status")`, which doesn't work
119
+ // with PySpark Column objects that require explicit comparison operators.
120
+ // See regression tests in tests/python/regression-bugs.test.ts
109
121
  'E713', // not-in-test
110
122
  'E714', // not-is-test
111
123
  // F - Pyflakes (only cell-safe rules)
@@ -173,7 +173,8 @@ declare class SqlBaseParser extends antlr4.Parser {
173
173
  functionTableNamedArgumentExpression(): FunctionTableNamedArgumentExpressionContext;
174
174
  functionTableReferenceArgument(): FunctionTableReferenceArgumentContext;
175
175
  functionTableArgument(): FunctionTableArgumentContext;
176
- functionTable(): FunctionTableContext;
176
+ tableFunctionCall(): TableFunctionCallContext;
177
+ tableFunctionCallWithTrailingClauses(): TableFunctionCallWithTrailingClausesContext;
177
178
  tableAlias(): TableAliasContext;
178
179
  rowFormat(): RowFormatContext;
179
180
  multipartIdentifierList(): MultipartIdentifierListContext;
@@ -919,7 +920,8 @@ declare namespace SqlBaseParser {
919
920
  export let RULE_functionTableNamedArgumentExpression: number;
920
921
  export let RULE_functionTableReferenceArgument: number;
921
922
  export let RULE_functionTableArgument: number;
922
- export let RULE_functionTable: number;
923
+ export let RULE_tableFunctionCall: number;
924
+ export let RULE_tableFunctionCallWithTrailingClauses: number;
923
925
  export let RULE_tableAlias: number;
924
926
  export let RULE_rowFormat: number;
925
927
  export let RULE_multipartIdentifierList: number;
@@ -1130,6 +1132,7 @@ declare namespace SqlBaseParser {
1130
1132
  export { CacheTableContext };
1131
1133
  export { AddTableColumnsContext };
1132
1134
  export { SetTablePropertiesContext };
1135
+ export { StreamTableValuedFunctionContext };
1133
1136
  export { StreamTableNameContext };
1134
1137
  export { SetQuotedConfigurationContext };
1135
1138
  export { ResetQuotedConfigurationContext };
@@ -1406,7 +1409,8 @@ declare namespace SqlBaseParser {
1406
1409
  export { FunctionTableNamedArgumentExpressionContext };
1407
1410
  export { FunctionTableReferenceArgumentContext };
1408
1411
  export { FunctionTableArgumentContext };
1409
- export { FunctionTableContext };
1412
+ export { TableFunctionCallContext };
1413
+ export { TableFunctionCallWithTrailingClausesContext };
1410
1414
  export { TableAliasContext };
1411
1415
  export { RowFormatContext };
1412
1416
  export { MultipartIdentifierListContext };
@@ -3482,22 +3486,32 @@ declare class FunctionTableArgumentContext {
3482
3486
  exitRule(listener: any): void;
3483
3487
  accept(visitor: any): any;
3484
3488
  }
3485
- declare class FunctionTableContext {
3489
+ declare class TableFunctionCallContext {
3486
3490
  constructor(parser: any, parent: any, invokingState: any);
3487
3491
  parser: any;
3488
3492
  ruleIndex: number;
3489
3493
  funcName: any;
3490
3494
  LEFT_PAREN(): any;
3491
3495
  RIGHT_PAREN(): any;
3492
- tableAlias(): any;
3493
3496
  functionName(): any;
3494
3497
  functionTableArgument: (i: any) => any;
3495
- watermarkClause(): any;
3496
3498
  COMMA: (i: any) => any;
3497
3499
  enterRule(listener: any): void;
3498
3500
  exitRule(listener: any): void;
3499
3501
  accept(visitor: any): any;
3500
3502
  }
3503
+ declare class TableFunctionCallWithTrailingClausesContext {
3504
+ constructor(parser: any, parent: any, invokingState: any);
3505
+ parser: any;
3506
+ ruleIndex: number;
3507
+ tableFunctionCall(): any;
3508
+ tableAlias(): any;
3509
+ identifiedByClause(): any;
3510
+ watermarkClause(): any;
3511
+ enterRule(listener: any): void;
3512
+ exitRule(listener: any): void;
3513
+ accept(visitor: any): any;
3514
+ }
3501
3515
  declare class TableAliasContext {
3502
3516
  constructor(parser: any, parent: any, invokingState: any);
3503
3517
  parser: any;
@@ -4907,7 +4921,7 @@ declare class OperatorPipeRightSideContext {
4907
4921
  SET(): any;
4908
4922
  operatorPipeSetAssignmentSeq(): any;
4909
4923
  DROP(): any;
4910
- identifierSeq(): any;
4924
+ multipartIdentifierList(): any;
4911
4925
  AS(): any;
4912
4926
  errorCapturingIdentifier(): any;
4913
4927
  whereClause(): any;
@@ -6874,6 +6888,20 @@ declare class SetTablePropertiesContext extends StatementContext {
6874
6888
  exitRule(listener: any): void;
6875
6889
  accept(visitor: any): any;
6876
6890
  }
6891
+ declare class StreamTableValuedFunctionContext extends StreamRelationPrimaryContext {
6892
+ constructor(parser: any, ctx: any);
6893
+ STREAM(): any;
6894
+ tableFunctionCallWithTrailingClauses(): any;
6895
+ LEFT_PAREN(): any;
6896
+ tableFunctionCall(): any;
6897
+ RIGHT_PAREN(): any;
6898
+ tableAlias(): any;
6899
+ identifiedByClause(): any;
6900
+ watermarkClause(): any;
6901
+ enterRule(listener: any): void;
6902
+ exitRule(listener: any): void;
6903
+ accept(visitor: any): any;
6904
+ }
6877
6905
  declare class StreamTableNameContext extends StreamRelationPrimaryContext {
6878
6906
  constructor(parser: any, ctx: any);
6879
6907
  STREAM(): any;
@@ -7322,7 +7350,7 @@ declare class StreamRelationContext extends RelationPrimaryContext {
7322
7350
  }
7323
7351
  declare class TableValuedFunctionContext extends RelationPrimaryContext {
7324
7352
  constructor(parser: any, ctx: any);
7325
- functionTable(): any;
7353
+ tableFunctionCallWithTrailingClauses(): any;
7326
7354
  enterRule(listener: any): void;
7327
7355
  exitRule(listener: any): void;
7328
7356
  accept(visitor: any): any;