sqlfluff / sqlfluff

Compare 2a51497 ... +0 ... 11709ca

Coverage Reach
core/parser/segments/base.py core/parser/segments/raw.py core/parser/segments/meta.py core/parser/segments/ephemeral.py core/parser/segments/__init__.py core/parser/segments/generator.py core/parser/grammar/base.py core/parser/grammar/sequence.py core/parser/grammar/anyof.py core/parser/grammar/delimited.py core/parser/grammar/greedy.py core/parser/grammar/conditional.py core/parser/grammar/noncode.py core/parser/grammar/__init__.py core/parser/lexer.py core/parser/parsers.py core/parser/context.py core/parser/markers.py core/parser/match_result.py core/parser/match_logging.py core/parser/helpers.py core/parser/match_wrapper.py core/parser/parser.py core/parser/matchable.py core/parser/__init__.py core/templaters/python.py core/templaters/slicers/tracer.py core/templaters/jinja.py core/templaters/base.py core/templaters/placeholder.py core/templaters/__init__.py core/linter/linter.py core/linter/linted_file.py core/linter/linting_result.py core/linter/runner.py core/linter/linted_dir.py core/linter/common.py core/linter/__init__.py core/rules/base.py core/rules/crawlers.py core/rules/doc_decorators.py core/rules/context.py core/rules/__init__.py core/rules/loader.py core/rules/reference.py core/rules/config_info.py core/config.py core/dialects/base.py core/dialects/__init__.py core/dialects/common.py core/errors.py core/plugin/lib.py core/plugin/hookspecs.py core/plugin/host.py core/plugin/__init__.py core/timing.py core/string_helpers.py core/enums.py core/__init__.py core/file_helpers.py core/cached_property.py dialects/dialect_exasol.py dialects/dialect_ansi.py dialects/dialect_tsql.py dialects/dialect_snowflake.py dialects/dialect_postgres.py dialects/dialect_bigquery.py dialects/dialect_sparksql.py dialects/dialect_mysql.py dialects/dialect_redshift.py dialects/dialect_hive.py dialects/dialect_materialize.py dialects/dialect_teradata.py dialects/dialect_athena.py dialects/dialect_oracle.py dialects/dialect_clickhouse.py dialects/dialect_postgres_keywords.py dialects/dialect_sqlite.py dialects/dialect_soql.py dialects/dialect_db2.py dialects/dialect_exasol_keywords.py dialects/dialect_mysql_keywords.py dialects/dialect_redshift_keywords.py dialects/dialect_materialize_keywords.py dialects/dialect_bigquery_keywords.py dialects/dialect_athena_keywords.py dialects/dialect_tsql_keywords.py dialects/dialect_ansi_keywords.py dialects/dialect_snowflake_keywords.py dialects/dialect_hive_keywords.py dialects/dialect_sparksql_keywords.py dialects/dialect_clickhouse_keywords.py rules/L003.py rules/L016.py rules/L042.py rules/L036.py rules/L052.py rules/L069.py rules/L010.py rules/L028.py rules/L026.py rules/L064.py rules/L022.py rules/L031.py rules/L057.py rules/L034.py rules/L025.py rules/L032.py rules/L070.py rules/L043.py rules/L046.py rules/L059.py rules/L044.py rules/L053.py rules/L013.py rules/L009.py rules/L015.py rules/L018.py rules/L037.py rules/L041.py rules/L049.py rules/L066.py rules/L027.py rules/L029.py rules/L058.py rules/L014.py rules/L045.py rules/L062.py rules/L004.py rules/L020.py rules/L063.py rules/L054.py rules/L047.py rules/L011.py rules/L050.py rules/L038.py rules/L051.py rules/L017.py rules/L023.py rules/L035.py rules/L002.py rules/L021.py rules/L033.py rules/L061.py rules/L056.py rules/L030.py rules/L060.py rules/L006.py rules/L012.py rules/L019.py rules/L039.py rules/L005.py rules/L055.py rules/L001.py rules/L007.py rules/L040.py rules/L048.py rules/L065.py rules/L008.py rules/L024.py rules/__init__.py utils/reflow/rebreak.py utils/reflow/elements.py utils/reflow/respace.py utils/reflow/sequence.py utils/reflow/depthmap.py utils/reflow/config.py utils/reflow/reindent.py utils/reflow/helpers.py utils/reflow/__init__.py utils/analysis/select_crawler.py utils/analysis/select.py utils/functional/segments.py utils/functional/segment_predicates.py utils/functional/raw_file_slices.py utils/functional/context.py utils/functional/templated_file_slices.py utils/functional/templated_file_slice_predicates.py utils/functional/raw_file_slice_predicates.py utils/functional/__init__.py utils/testing/rules.py utils/testing/cli.py cli/commands.py cli/formatters.py cli/click_deprecated_option.py cli/outputstream.py cli/helpers.py cli/autocomplete.py cli/__init__.py api/simple.py api/info.py api/__init__.py diff_quality_plugin.py __init__.py __main__.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -195,6 +195,7 @@
Loading
195 195
DATA
196 196
DATABASE
197 197
DATABASES
198 +
DATA_FORMAT
198 199
DATA_RETENTION_TIME_IN_DAYS
199 200
DATE
200 201
DATE_FORMAT
@@ -390,6 +391,7 @@
Loading
390 391
PASSWORD
391 392
PAST
392 393
PATTERN
394 +
FIELD_OPTIONALITY_ENCLOSED_BY
393 395
PER
394 396
PERMUTE
395 397
PIPE

@@ -4073,6 +4073,12 @@
Loading
4073 4073
4074 4074
    https://docs.snowflake.com/en/sql-reference/sql/copy-into-table.html#format-type-options
4075 4075
    https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html#format-type-options
4076 +
4077 +
    This part specifically works for the format:
4078 +
        `FILE_FORMAT = (FORMAT_NAME = myformatname)`
4079 +
    Another case:
4080 +
        `FILE_FORMAT = (TYPE = mytype)` their fileFormatOptions are implemented in
4081 +
    their specific `FormatTypeParameters`
4076 4082
    """
4077 4083
4078 4084
    type = "format_type_options"
@@ -4105,6 +4111,44 @@
Loading
4105 4111
                Ref("EqualsSegment"),
4106 4112
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4107 4113
            ),
4114 +
            Sequence(
4115 +
                "DATA_FORMAT",
4116 +
                Ref("EqualsSegment"),
4117 +
                OneOf("AUTO", Ref("QuotedLiteralSegment")),
4118 +
            ),
4119 +
            Sequence(
4120 +
                "TIME_FORMAT",
4121 +
                Ref("EqualsSegment"),
4122 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4123 +
            ),
4124 +
            Sequence(
4125 +
                "TIMESTAMP_FORMAT",
4126 +
                Ref("EqualsSegment"),
4127 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4128 +
            ),
4129 +
            Sequence(
4130 +
                "BINARY_FORMAT", Ref("EqualsSegment"), OneOf("HEX", "BASE64", "UTF8")
4131 +
            ),
4132 +
            Sequence(
4133 +
                "FIELD_OPTIONALITY_ENCLOSED_BY",
4134 +
                Ref("EqualsSegment"),
4135 +
                OneOf("NONE", Ref("QuotedLiteralSegment")),
4136 +
            ),
4137 +
            Sequence(
4138 +
                "NULL_IF",
4139 +
                Ref("EqualsSegment"),
4140 +
                Bracketed(Delimited(Ref("QuotedLiteralSegment"))),
4141 +
            ),
4142 +
            Sequence(
4143 +
                "EMPTY_FIELD_AS_NULL",
4144 +
                Ref("EqualsSegment"),
4145 +
                Ref("BooleanLiteralGrammar"),
4146 +
            ),
4147 +
            Sequence(
4148 +
                "SNAPPY_COMPRESSION",
4149 +
                Ref("EqualsSegment"),
4150 +
                Ref("BooleanLiteralGrammar"),
4151 +
            ),
4108 4152
        ),
4109 4153
        # COPY INTO <table>, open for extension
4110 4154
        AnySetOf(),
@@ -4232,6 +4276,21 @@
Loading
4232 4276
    )
4233 4277
4234 4278
4279 +
class PartitionBySegment(BaseSegment):
4280 +
    """A `PARTITION BY` for `copy_into_location` functions."""
4281 +
4282 +
    type = "partition_by_segment"
4283 +
4284 +
    match_grammar: Matchable = Sequence(
4285 +
        "PARTITION",
4286 +
        "BY",
4287 +
        Indent,
4288 +
        # Brackets are optional in a partition by statement
4289 +
        OptionallyBracketed(Delimited(Ref("ExpressionSegment"))),
4290 +
        Dedent,
4291 +
    )
4292 +
4293 +
4235 4294
class CopyIntoLocationStatementSegment(BaseSegment):
4236 4295
    """A Snowflake `COPY INTO <location>` statement.
4237 4296
@@ -4253,28 +4312,30 @@
Loading
4253 4312
            ),
4254 4313
            optional=True,
4255 4314
        ),
4256 -
        Ref("S3ExternalStageParameters", optional=True),
4315 +
        OneOf(
4316 +
            Ref("S3ExternalStageParameters"),
4317 +
            Ref("AzureBlobStorageExternalStageParameters"),
4318 +
            optional=True,
4319 +
        ),
4257 4320
        Ref("InternalStageParameters", optional=True),
4258 4321
        AnySetOf(
4259 -
            Ref("PartitionClauseSegment"),
4322 +
            Ref("PartitionBySegment"),
4260 4323
            Sequence(
4261 4324
                "FILE_FORMAT",
4262 4325
                Ref("EqualsSegment"),
4263 4326
                Ref("FileFormatSegment"),
4264 4327
            ),
4265 4328
            Ref("CopyOptionsSegment"),
4266 -
        ),
4267 -
        Sequence(
4268 -
            "VALIDATION_MODE",
4269 -
            Ref("EqualsSegment"),
4270 -
            Ref("ValidationModeOptionSegment"),
4271 -
            optional=True,
4272 -
        ),
4273 -
        Sequence(
4274 -
            "HEADER",
4275 -
            Ref("EqualsSegment"),
4276 -
            Ref("BooleanLiteralGrammar"),
4277 -
            optional=True,
4329 +
            Sequence(
4330 +
                "VALIDATION_MODE",
4331 +
                Ref("EqualsSegment"),
4332 +
                Ref("ValidationModeOptionSegment"),
4333 +
            ),
4334 +
            Sequence(
4335 +
                "HEADER",
4336 +
                Ref("EqualsSegment"),
4337 +
                Ref("BooleanLiteralGrammar"),
4338 +
            ),
4278 4339
        ),
4279 4340
    )
4280 4341
@@ -4300,7 +4361,11 @@
Loading
4300 4361
            ),
4301 4362
            optional=True,
4302 4363
        ),
4303 -
        Ref("S3ExternalStageParameters", optional=True),
4364 +
        OneOf(
4365 +
            Ref("S3ExternalStageParameters"),
4366 +
            Ref("AzureBlobStorageExternalStageParameters"),
4367 +
            optional=True,
4368 +
        ),
4304 4369
        Ref("InternalStageParameters", optional=True),
4305 4370
        AnySetOf(
4306 4371
            Sequence(

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src/sqlfluff 100.00%
Project Totals (195 files) 100.00%
Loading