Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metrics): add wildcard support to MQL parser #5972

Merged
merged 7 commits into from
Jul 15, 2024

Conversation

shellmayr
Copy link
Member

Contributes to getsentry/sentry#69852

Copy link

codecov bot commented May 24, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 1685 tests with 1 failed, 1682 passed and 2 skipped.

View the full list of failed tests

pytest

  • Class name: tests.query.parser.test_formula_mql_query
    Test name: test_simple_formula

    Traceback (most recent call last):
    File ".../query/parser/test_formula_mql_query.py", line 265, in test_simple_formula
    assert eq, reason
    AssertionError: get_condition: and(
    and(
    and(
    greaterOrEquals(
    d0.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T18:30:00)
    ),
    and(
    less(
    d0.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T22:30:00)
    ),
    in(
    d0.project_id AS `_snuba_project_id`,
    tuple(
    11
    )
    )
    )
    ),
    and(
    and(
    in(
    d0.org_id AS `_snuba_org_id`,
    tuple(
    1
    )
    ),
    equals(
    d0.use_case_id AS `_snuba_use_case_id`,
    'transactions'
    )
    ),
    and(
    equals(
    d0.granularity AS `_snuba_granularity`,
    60
    ),
    greaterOrEquals(
    d1.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T18:30:00)
    )
    )
    )
    ),
    and(
    and(
    and(
    less(
    d1.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T22:30:00)
    ),
    in(
    d1.project_id AS `_snuba_project_id`,
    tuple(
    11
    )
    )
    ),
    and(
    in(
    d1.org_id AS `_snuba_org_id`,
    tuple(
    1
    )
    ),
    equals(
    d1.use_case_id AS `_snuba_use_case_id`,
    'transactions'
    )
    )
    ),
    and(
    and(
    equals(
    d1.granularity AS `_snuba_granularity`,
    60
    ),
    in(
    ( d0.tags_raw AS `_snuba_tags_raw`)['222222'] AS `_snuba_tags_raw[222222]`,
    tuple(
    )
    )
    ),
    and(
    equals(
    d0.metric_id AS `_snuba_metric_id`,
    123456
    ),
    equals(
    d1.metric_id AS `_snuba_metric_id`,
    123456
    )
    )
    )
    )
    ) != and(
    and(
    and(
    greaterOrEquals(
    d0.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T18:30:00)
    ),
    and(
    less(
    d0.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T22:30:00)
    ),
    in(
    d0.project_id AS `_snuba_project_id`,
    tuple(
    11
    )
    )
    )
    ),
    and(
    and(
    in(
    d0.org_id AS `_snuba_org_id`,
    tuple(
    1
    )
    ),
    equals(
    d0.use_case_id AS `_snuba_use_case_id`,
    'transactions'
    )
    ),
    and(
    equals(
    d0.granularity AS `_snuba_granularity`,
    60
    ),
    greaterOrEquals(
    d1.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T18:30:00)
    )
    )
    )
    ),
    and(
    and(
    and(
    less(
    d1.timestamp AS `_snuba_timestamp`,
    datetime(2023-11-23T22:30:00)
    ),
    in(
    d1.project_id AS `_snuba_project_id`,
    tuple(
    11
    )
    )
    ),
    and(
    in(
    d1.org_id AS `_snuba_org_id`,
    tuple(
    1
    )
    ),
    equals(
    d1.use_case_id AS `_snuba_use_case_id`,
    'transactions'
    )
    )
    ),
    and(
    and(
    equals(
    d1.granularity AS `_snuba_granularity`,
    60
    ),
    equals(
    ( d0.tags_raw AS `_snuba_tags_raw`)['222222'] AS `_snuba_tags_raw[222222]`,
    '200'
    )
    ),
    and(
    equals(
    d0.metric_id AS `_snuba_metric_id`,
    123456
    ),
    equals(
    d1.metric_id AS `_snuba_metric_id`,
    123456
    )
    )
    )
    )
    )
    assert False

@shellmayr shellmayr force-pushed the shellmayr/feat/add-wildcard-support-to-mql-parser branch from 62f61ed to 977c125 Compare July 11, 2024 08:56
@shellmayr shellmayr marked this pull request as ready for review July 11, 2024 14:54
@shellmayr shellmayr requested a review from a team as a code owner July 11, 2024 14:54
Copy link
Member

@evanh evanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but there is a failing test. Please address that before merging.

@shellmayr shellmayr merged commit be7bace into master Jul 15, 2024
29 checks passed
@shellmayr shellmayr deleted the shellmayr/feat/add-wildcard-support-to-mql-parser branch July 15, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants