diff --git a/.changes/unreleased/Dependencies-20251006-144510.yaml b/.changes/unreleased/Dependencies-20251006-144510.yaml index 53129bab82..30a6f0f7ce 100644 --- a/.changes/unreleased/Dependencies-20251006-144510.yaml +++ b/.changes/unreleased/Dependencies-20251006-144510.yaml @@ -2,5 +2,5 @@ kind: Dependencies body: Update requirement for dependency `more-itertools` to include newest version time: 2025-10-06T14:45:10.7005413+02:00 custom: - Author: MatthijsKok - Issue: "1879" + Author: MatthijsKok + Issue: "1879" diff --git a/.changes/unreleased/Docs-20250811-160039.yaml b/.changes/unreleased/Docs-20250811-160039.yaml index 390d3a0268..59de21b428 100644 --- a/.changes/unreleased/Docs-20250811-160039.yaml +++ b/.changes/unreleased/Docs-20250811-160039.yaml @@ -2,5 +2,5 @@ kind: Docs body: Update help text for `mf query` options time: 2025-08-11T16:00:39.193958+02:00 custom: - Author: b-per - Issue: "1815" + Author: b-per + Issue: "1815" diff --git a/.changes/unreleased/Features-20251002-171248.yaml b/.changes/unreleased/Features-20251002-171248.yaml index 2bd88b79af..2a57921659 100644 --- a/.changes/unreleased/Features-20251002-171248.yaml +++ b/.changes/unreleased/Features-20251002-171248.yaml @@ -2,5 +2,5 @@ kind: Features body: Add new transformations to production from dsi that produce metrics from old-style measures. time: 2025-10-02T17:12:48.436607-07:00 custom: - Author: theyostalservice - Issue: "387" + Author: theyostalservice + Issue: "387" diff --git a/.changes/unreleased/Features-20251017-212002.yaml b/.changes/unreleased/Features-20251017-212002.yaml new file mode 100644 index 0000000000..687d1b3b8a --- /dev/null +++ b/.changes/unreleased/Features-20251017-212002.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Add YAML formatter to pre-commit hooks. +time: 2025-10-17T21:20:02.367445+09:00 +custom: + Author: kiwamizamurai + Issue: '237' diff --git a/.changes/unreleased/Fixes-20251015-143827.yaml b/.changes/unreleased/Fixes-20251015-143827.yaml index aa0ffc1456..ff3e7cf509 100644 --- a/.changes/unreleased/Fixes-20251015-143827.yaml +++ b/.changes/unreleased/Fixes-20251015-143827.yaml @@ -1,6 +1,5 @@ kind: Fixes -body: Fixes a bug related to leaving out metric values in offset metrics, specifically - if the queried grain is smaller than the offset grain. +body: Fixes a bug related to leaving out metric values in offset metrics, specifically if the queried grain is smaller than the offset grain. time: 2025-10-15T14:38:27.163025-04:00 custom: Author: courtneyholcomb diff --git a/.changes/unreleased/Under the Hood-20251003-080025.yaml b/.changes/unreleased/Under the Hood-20251003-080025.yaml index 698f1fbd56..174415b15c 100644 --- a/.changes/unreleased/Under the Hood-20251003-080025.yaml +++ b/.changes/unreleased/Under the Hood-20251003-080025.yaml @@ -2,5 +2,5 @@ kind: Under the Hood body: Bump dependence on dbt-semantic-interfaces to 0.9.3.dev4 to get newest transformations code. time: 2025-10-03T08:00:25.705141-07:00 custom: - Author: theyostalservice courtneyholcomb - Issue: "387" + Author: theyostalservice courtneyholcomb + Issue: "387" diff --git a/.changie.yaml b/.changie.yaml index ed4256ee38..899a46247c 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -19,7 +19,6 @@ changeFormat: |- {{- end -}} {{- end -}} - {{.Body}}{{if $IssueList}} ({{ join ", " $IssueList }}){{end}} - kinds: - label: Breaking Changes - label: Features @@ -28,24 +27,21 @@ kinds: - label: Under the Hood - label: Dependencies - label: Security - newlines: afterChangelogHeader: 1 afterKind: 1 afterChangelogVersion: 1 beforeKind: 1 endOfVersion: 1 - custom: -- key: Author - label: GitHub Username(s) (separated by a single space if multiple) - type: string - minLength: 3 -- key: Issue - label: "GitHub Issue (or PR) Number(s) (separated by a single space if multiple)" - type: string - minLength: 1 - + - key: Author + label: GitHub Username(s) (separated by a single space if multiple) + type: string + minLength: 3 + - key: Issue + label: "GitHub Issue (or PR) Number(s) (separated by a single space if multiple)" + type: string + minLength: 1 footerFormat: | {{- $contributorDict := dict }} {{- /* ensure we always skip snyk and dependabot in addition to the core team */}} diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 753d0b1a0e..ac2c15e068 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -13,10 +13,11 @@ body: description: > In other words, is this an error, flaw, failure or fault in our software? - If this is a bug that broke existing functionality that used to work, please open a regression issue. - If this is a bug experienced while using the Semantic Layer, please report to [support](mailto:support@getdbt.com). + If this is a bug that broke existing functionality that used to work, please open a regression issue. If this is a bug experienced while using the + Semantic Layer, please report to [support](mailto:support@getdbt.com). Please search to see if an issue already exists for the bug you encountered. + options: - label: I believe this is a new bug in metricflow required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 1b9c56ba32..6267ce1419 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -11,12 +11,11 @@ body: attributes: label: Is this your first time submitting a feature request? description: > - We want to make sure that features are distinct and discoverable, - so that other members of the community can find them and offer their thoughts. + We want to make sure that features are distinct and discoverable, so that other members of the community can find them and offer their thoughts. + + Issues are the right place to request straightforward extensions of existing metricflow functionality. For "big ideas" about future capabilities + of metricflow, we ask that you open a [discussion](https://github.com/dbt-labs/metricflow/discussions) in the "Ideas" category instead. - Issues are the right place to request straightforward extensions of existing metricflow functionality. - For "big ideas" about future capabilities of metricflow, we ask that you open a - [discussion](https://github.com/dbt-labs/metricflow/discussions) in the "Ideas" category instead. options: - label: I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations) required: true diff --git a/.github/ISSUE_TEMPLATE/regression-report.yml b/.github/ISSUE_TEMPLATE/regression-report.yml index 8969b9a59a..88ab3f3b9e 100644 --- a/.github/ISSUE_TEMPLATE/regression-report.yml +++ b/.github/ISSUE_TEMPLATE/regression-report.yml @@ -11,8 +11,9 @@ body: attributes: label: Is this a regression in a recent version of metricflow? description: > - A regression is when documented functionality works as expected in an older version of metricflow, - and no longer works after upgrading to a newer version of metricflow + A regression is when documented functionality works as expected in an older version of metricflow, and no longer works after upgrading to a newer + version of metricflow + options: - label: I believe this is a regression in metricflow functionality required: true diff --git a/.github/actions/run-mf-tests/action.yaml b/.github/actions/run-mf-tests/action.yaml index e8e68962c1..e0dd32b9a4 100644 --- a/.github/actions/run-mf-tests/action.yaml +++ b/.github/actions/run-mf-tests/action.yaml @@ -1,6 +1,5 @@ name: Run MetricFlow Tests description: Runs MetricFlow using the specified Python version and engine settings. - inputs: python-version: description: "Version of Python to use for testing." @@ -31,38 +30,35 @@ inputs: required: false default: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "dev-env"}, {"hatch_project_directory": "./metricflow-semantics", "hatch_environment_name": "dev-env"} ] } - runs: using: "composite" steps: - - uses: ./.github/actions/setup-python-env - with: - python-version: "${{ inputs.python-version }}" - hatch-environment-cache-config-json: "${{ inputs.hatch-environment-cache-config-json }}" - - - name: Cache APT Packages - uses: awalsh128/cache-apt-pkgs-action@v1.4.3 - with: - packages: graphviz - version: "@latest" - - - name: Register `graphviz` plug-ins - shell: bash - run: "sudo dot -c" + - uses: ./.github/actions/setup-python-env + with: + python-version: "${{ inputs.python-version }}" + hatch-environment-cache-config-json: "${{ inputs.hatch-environment-cache-config-json }}" + - name: Cache APT Packages + uses: awalsh128/cache-apt-pkgs-action@v1.4.3 + with: + packages: graphviz + version: "@latest" + - name: Register `graphviz` plug-ins + shell: bash + run: "sudo dot -c" + - name: Run Tests w/ Python ${{ inputs.python-version }} + shell: bash + run: > + make -e PARALLELISM=${{ inputs.parallelism }} ADDITIONAL_PYTEST_OPTIONS="${{ inputs.additional-pytest-options }}" ${{ inputs.make-target }} - - name: Run Tests w/ Python ${{ inputs.python-version }} - shell: bash - run: > - make -e - PARALLELISM=${{ inputs.parallelism }} - ADDITIONAL_PYTEST_OPTIONS="${{ inputs.additional-pytest-options }}" - ${{ inputs.make-target }} - env: - MF_SQL_ENGINE_URL: ${{ inputs.mf_sql_engine_url }} - MF_SQL_ENGINE_PASSWORD: ${{ inputs.mf_sql_engine_password }} - METRICFLOW_CLIENT_EMAIL: ci-tester@gmail.com + env: + MF_SQL_ENGINE_URL: ${{ inputs.mf_sql_engine_url }} + MF_SQL_ENGINE_PASSWORD: ${{ inputs.mf_sql_engine_password }} + METRICFLOW_CLIENT_EMAIL: ci-tester@gmail.com diff --git a/.github/actions/setup-python-env/action.yaml b/.github/actions/setup-python-env/action.yaml index 0668685eba..183f29b93a 100644 --- a/.github/actions/setup-python-env/action.yaml +++ b/.github/actions/setup-python-env/action.yaml @@ -1,6 +1,5 @@ name: Setup Python Environment description: Install Python & Hatch - inputs: python-version: description: "Version of Python to use for testing" @@ -11,78 +10,71 @@ inputs: required: false default: >- { + + + "configs": [] } cache-pre-commit-environment: description: "Whether to cache the pre-commit-environment." required: false default: "false" - runs: using: "composite" - steps: - - name: Set Linux Release Environment Variable - shell: bash - run: echo "LINUX_RELEASE=$(lsb_release -rs)" >> $GITHUB_ENV - - - name: Set up Python ${{ inputs.python_version }} - uses: actions/setup-python@v4 - with: - python-version: "${{ inputs.python-version }}" - - - name: Create a JSON File With the `hatch` Environment Cache Configuration - shell: bash - run: "echo '${{ inputs.hatch-environment-cache-config-json }}' > hatch-environment-cache-config.json" - - # Cache the dependencies installed by Hatch so that we don't need to reinstall them on every run. - - uses: actions/cache@v3 - with: - # Save pip cache. - # Save Hatch environments. - # Save the package cache for Hatch. - # Save pre-commit environments. - path: | - ${{ env.pythonLocation }} - ~/.cache/pip - ~/.local/share/hatch - ~/.cache/hatch - ~/.cache/pre-commit - # >- means combine all lines to a single line - # The cache key can be any string. The format used here is just for readability. - # `manual_update_key` can be changed to manually force the cache action to create a new cache. - key: >- - python_location: "${{ env.pythonLocation }}" AND - files_hash: "${{ - hashFiles( - 'pyproject.toml' - , '**/requirements-files/*' - , '.pre-commit-config.yaml' - , 'hatch-environment-cache-config.json' - ) - }}" AND - linux_release: "${{ env.LINUX_RELEASE }}" AND - cache-pre-commit-environment: "${{ inputs.cache-pre-commit-environment }}" AND - manual_update_key: 2 + - name: Set Linux Release Environment Variable + shell: bash + run: echo "LINUX_RELEASE=$(lsb_release -rs)" >> $GITHUB_ENV + - name: Set up Python ${{ inputs.python_version }} + uses: actions/setup-python@v4 + with: + python-version: "${{ inputs.python-version }}" + - name: Create a JSON File With the `hatch` Environment Cache Configuration + shell: bash + run: "echo '${{ inputs.hatch-environment-cache-config-json }}' > hatch-environment-cache-config.json" + # Cache the dependencies installed by Hatch so that we don't need to reinstall them on every run. + - uses: actions/cache@v3 + with: + # Save pip cache. + # Save Hatch environments. + # Save the package cache for Hatch. + # Save pre-commit environments. + path: | + ${{ env.pythonLocation }} + ~/.cache/pip + ~/.local/share/hatch + ~/.cache/hatch + ~/.cache/pre-commit + # >- means combine all lines to a single line + # The cache key can be any string. The format used here is just for readability. + # `manual_update_key` can be changed to manually force the cache action to create a new cache. + key: >- + python_location: "${{ env.pythonLocation }}" AND files_hash: "${{ - - name: Install Hatch - shell: bash - # Pin click to avoid bug in 8.3.0 - can remove when a fix is released - run: | - pip3 install "click<8.3.0" - pip3 install hatch - # Running any command will install the dependencies for the project. Add this step so that the `hatch` environment is - # cached. - - name: Install Dependencies for Hatch Environment - shell: bash - run: >- - PYTHONPATH=. - python scripts/ci_tests/install_hatch_environments.py - --json-config-file 'hatch-environment-cache-config.json' - # Add this step to cache the `pre-commit` environment. - - name: Install `pre-commit` Environment - shell: bash - if: ${{ inputs.cache-pre-commit-environment == 'true' }} - run: "hatch run dev-env:pre-commit install-hooks" + hashFiles( + 'pyproject.toml' + , '**/requirements-files/*' + , '.pre-commit-config.yaml' + , 'hatch-environment-cache-config.json' + ) + }}" AND linux_release: "${{ env.LINUX_RELEASE }}" AND cache-pre-commit-environment: "${{ inputs.cache-pre-commit-environment }}" AND manual_update_key: + 2 + - name: Install Hatch + shell: bash + # Pin click to avoid bug in 8.3.0 - can remove when a fix is released + run: | + pip3 install "click<8.3.0" + pip3 install hatch + # Running any command will install the dependencies for the project. Add this step so that the `hatch` environment is + # cached. + - name: Install Dependencies for Hatch Environment + shell: bash + run: >- + PYTHONPATH=. python scripts/ci_tests/install_hatch_environments.py --json-config-file 'hatch-environment-cache-config.json' + # Add this step to cache the `pre-commit` environment. + - name: Install `pre-commit` Environment + shell: bash + if: ${{ inputs.cache-pre-commit-environment == 'true' }} + run: "hatch run dev-env:pre-commit install-hooks" diff --git a/.github/workflows/bot-changelog.yml b/.github/workflows/bot-changelog.yml index 1ea4aad69f..b27b4048ab 100644 --- a/.github/workflows/bot-changelog.yml +++ b/.github/workflows/bot-changelog.yml @@ -22,18 +22,14 @@ # **how to add another bot?** # Add the label and changie kind to the include matrix. That's it! # - name: Bot Changelog - on: pull_request: # catch when the PR is opened with the label or when the label is added types: [labeled] - permissions: contents: write pull-requests: read - jobs: generate_changelog: strategy: @@ -44,18 +40,16 @@ jobs: - label: "snyk" changie_kind: "Security" runs-on: ubuntu-latest - steps: - - - name: Create and commit changelog on bot PR - if: ${{ contains(github.event.pull_request.labels.*.name, matrix.label) }} - id: bot_changelog - uses: emmyoop/changie_bot@v1 - with: - GITHUB_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }} - commit_author_name: "Github Build Bot" - commit_author_email: "" - commit_message: "Add automated changelog yaml from template for bot PR" - changie_kind: ${{ matrix.changie_kind }} - label: ${{ matrix.label }} - custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: ${{ github.event.pull_request.number }}" + - name: Create and commit changelog on bot PR + if: ${{ contains(github.event.pull_request.labels.*.name, matrix.label) }} + id: bot_changelog + uses: emmyoop/changie_bot@v1 + with: + GITHUB_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }} + commit_author_name: "Github Build Bot" + commit_author_email: "" + commit_message: "Add automated changelog yaml from template for bot PR" + changie_kind: ${{ matrix.changie_kind }} + label: ${{ matrix.label }} + custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: ${{ github.event.pull_request.number }}" diff --git a/.github/workflows/cd-create-release-pr.yaml b/.github/workflows/cd-create-release-pr.yaml index ffe2c71d8c..d6617bf496 100644 --- a/.github/workflows/cd-create-release-pr.yaml +++ b/.github/workflows/cd-create-release-pr.yaml @@ -10,7 +10,6 @@ on: - major - minor - patch - jobs: create-release-pr: runs-on: ubuntu-latest @@ -18,69 +17,56 @@ jobs: name: "RELEASE_CREATION" steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-python-env - - name: Use Changie to Generate Change Log for the New Release uses: miniscruff/changie-action@v2 with: version: latest args: batch ${{ inputs.bump }} - - name: Use Changie to Update `CHANGELOG.md` To Include All Changes uses: miniscruff/changie-action@v2 with: version: latest args: merge - - name: Use Changie to Get the New Version Number id: changie-latest uses: miniscruff/changie-action@v2 with: version: latest args: latest - - name: Save the New Version Into Context id: get-new-package-version run: | VERSION_WITH_V_PREFIX="${{ steps.changie-latest.outputs.output }}" VERSION="$(echo "$VERSION_WITH_V_PREFIX" | cut -c 2-)" echo "version=\"$VERSION\"" >> "$GITHUB_OUTPUT" - - name: Update Project Version in Source Code via Hatch id: update-package-version run: >- hatch version "${{ steps.get-new-package-version.outputs.version }}" - - name: Install `fossa-cli` # This is the recommended install method on: https://github.com/fossas/fossa-cli # There doesn't seem to be a package that can be installed instead. run: >- - curl -H 'Cache-Control: no-cache' - https://raw.githubusercontent.com/fossas/fossa-cli/v3.9.42/install-latest.sh - | bash - + curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/v3.9.42/install-latest.sh | bash - name: Run `fossa analyze` and Upload Report env: FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} run: "fossa analyze" - - name: Use FOSSA Report to Update `ATTRIBUTION.md` env: FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} run: fossa report attribution --format markdown > ./ATTRIBUTION.md - - name: Fix Lint Issues in Generated Files run: "hatch -v run dev-env:pre-commit run --color=always --all-files" - - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: branch: release-${{ steps.get-new-package-version.outputs.version }} title: "Release PR for MetricFlow ${{ steps.get-new-package-version.outputs.version }}" body: > - Update changelog, version, and attribution for release version - `${{ steps.get-new-package-version.outputs.version }}` + Update changelog, version, and attribution for release version `${{ steps.get-new-package-version.outputs.version }}` + labels: "Skip Changelog" commit-message: | Release version: ${{ steps.get-new-package-version.outputs.version }} diff --git a/.github/workflows/cd-push-dbt-metricflow-to-pypi.yaml b/.github/workflows/cd-push-dbt-metricflow-to-pypi.yaml index c89fcf129e..af67e8976c 100644 --- a/.github/workflows/cd-push-dbt-metricflow-to-pypi.yaml +++ b/.github/workflows/cd-push-dbt-metricflow-to-pypi.yaml @@ -5,7 +5,6 @@ on: # Tag format is /v tags: - "dbt-metricflow/v[0-9]+.[0-9]+.[0-9]+*" - jobs: pypi-publish: runs-on: ubuntu-latest @@ -17,13 +16,10 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/setup-python-env - - name: Build `dbt-metricflow` package working-directory: ./dbt-metricflow run: hatch build - - name: Publish `dbt-metricflow` package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/cd-push-metricflow-to-pypi.yaml b/.github/workflows/cd-push-metricflow-to-pypi.yaml index 235839e2df..9b87f63e40 100644 --- a/.github/workflows/cd-push-metricflow-to-pypi.yaml +++ b/.github/workflows/cd-push-metricflow-to-pypi.yaml @@ -6,7 +6,6 @@ on: # We restrict to this for now and assume any tag without a package identifier is MetricFlow itself tags: - "v[0-9]+.[0-9]+.[0-9]+*" - jobs: pypi-publish: runs-on: ubuntu-latest @@ -18,11 +17,8 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/setup-python-env - - name: Build `metricflow` package run: hatch build - - name: Publish `metricflow` package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/cd-sql-engine-populate-persistent-source-schema.yaml b/.github/workflows/cd-sql-engine-populate-persistent-source-schema.yaml index d086da661d..7b0b619cf5 100644 --- a/.github/workflows/cd-sql-engine-populate-persistent-source-schema.yaml +++ b/.github/workflows/cd-sql-engine-populate-persistent-source-schema.yaml @@ -1,22 +1,17 @@ # See [Persistent Source Schema](/GLOSSARY.md#persistent-source-schema) # Populating the source schema via this workflow ensures that it's done with the same settings as the tests. - name: Reload Test Data in SQL Engines - # We don't want multiple workflows trying to create the same table. concurrency: group: POPULATE_PERSISTENT_SOURCE_SCHEMA cancel-in-progress: true - on: pull_request: types: [labeled] workflow_dispatch: - env: # Unclear on how to make 'Reload Test Data in SQL Engines' a constant here as it does not work here. ADDITIONAL_PYTEST_OPTIONS: "--log-cli-level info" - jobs: snowflake-populate: environment: DW_INTEGRATION_TESTS @@ -26,7 +21,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - name: Populate Snowflake uses: ./.github/actions/run-mf-tests with: @@ -35,7 +29,6 @@ jobs: parallelism: 1 additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }} make-target: "populate-persistent-source-schema-snowflake" - redshift-populate: environment: DW_INTEGRATION_TESTS name: Redshift @@ -44,7 +37,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - name: Populate Redshift uses: ./.github/actions/run-mf-tests with: @@ -53,7 +45,6 @@ jobs: parallelism: 1 additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }} make-target: "populate-persistent-source-schema-redshift" - bigquery-populate: environment: DW_INTEGRATION_TESTS name: BigQuery @@ -62,7 +53,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - name: Populate BigQuery uses: ./.github/actions/run-mf-tests with: @@ -71,7 +61,6 @@ jobs: parallelism: 1 additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }} make-target: "populate-persistent-source-schema-bigquery" - databricks-populate: environment: DW_INTEGRATION_TESTS name: Databricks SQL Warehouse @@ -80,7 +69,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - name: Populate Databricks uses: ./.github/actions/run-mf-tests with: @@ -89,11 +77,10 @@ jobs: parallelism: 1 additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }} make-target: "populate-persistent-source-schema-databricks" - remove-label: name: Remove Label After Populating Test Data runs-on: ubuntu-latest - needs: [ snowflake-populate, redshift-populate, bigquery-populate, databricks-populate] + needs: [snowflake-populate, redshift-populate, bigquery-populate, databricks-populate] if: github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines' steps: - name: Remove Label diff --git a/.github/workflows/cd-sql-engine-tests.yaml b/.github/workflows/cd-sql-engine-tests.yaml index 5e6314ed05..24057c1f78 100644 --- a/.github/workflows/cd-sql-engine-tests.yaml +++ b/.github/workflows/cd-sql-engine-tests.yaml @@ -4,14 +4,11 @@ name: MetricFlow SQL Engine Tests on: workflow_dispatch: - pull_request: types: [labeled] - env: EXTERNAL_ENGINE_TEST_PARALLELISM: 8 ADDITIONAL_PYTEST_OPTIONS: "--use-persistent-source-schema" - jobs: snowflake-tests: environment: DW_INTEGRATION_TESTS @@ -23,7 +20,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: mf_sql_engine_url: ${{ secrets.MF_SNOWFLAKE_URL }} @@ -33,11 +29,13 @@ jobs: make-target: "test-snowflake" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "snowflake-env"} ] } - redshift-tests: environment: DW_INTEGRATION_TESTS name: Redshift Tests @@ -46,7 +44,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: mf_sql_engine_url: ${{ secrets.MF_REDSHIFT_URL }} @@ -56,11 +53,13 @@ jobs: make-target: "test-redshift" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "redshift-env"} ] } - bigquery-tests: environment: DW_INTEGRATION_TESTS name: BigQuery Tests @@ -69,7 +68,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: MF_SQL_ENGINE_URL: ${{ secrets.MF_BIGQUERY_URL }} @@ -79,11 +77,13 @@ jobs: make-target: "test-bigquery" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "bigquery-env"} ] } - databricks-tests: environment: DW_INTEGRATION_TESTS name: Databricks Tests @@ -92,7 +92,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: mf_sql_engine_url: ${{ secrets.MF_DATABRICKS_URL }} @@ -102,11 +101,13 @@ jobs: make-target: "test-databricks" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "databricks-env"} ] } - trino-tests: # Trino tests run on a local service container, which obviates the need for separate Environment hosting. # We run them here instead of in the CI unit test suite because they are a bit slower, and because in future @@ -123,21 +124,22 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: make-target: "test-trino" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "trino-env"} ] } - remove-label: name: Remove Label After Running Tests runs-on: ubuntu-latest - needs: [ snowflake-tests, redshift-tests, bigquery-tests, databricks-tests ] + needs: [snowflake-tests, redshift-tests, bigquery-tests, databricks-tests] # Default behavior for `needs` is that it requires success, so a success / failure needs to be specifically checked. if: ${{ (success() || failure()) && github.event.action == 'labeled' }} steps: diff --git a/.github/workflows/changelog-existence.yml b/.github/workflows/changelog-existence.yml index f76b7fedd1..a301875728 100644 --- a/.github/workflows/changelog-existence.yml +++ b/.github/workflows/changelog-existence.yml @@ -6,35 +6,29 @@ # from forked repos. # By default, secrets are not passed to workflows running from # a forked repo. - # **why?** # Ensure code change gets reflected in the CHANGELOG. - # **when?** # This will run for all PRs going into main and *.latest. It will # run when they are opened, reopened, when any label is added or removed # and when new code is pushed to the branch. The action will then get # skipped if the 'Skip Changelog' label is present is any of the labels. - name: Check Changelog Entry - on: pull_request: types: [opened, reopened, labeled, unlabeled, synchronize] workflow_dispatch: - defaults: run: shell: bash - permissions: contents: read pull-requests: write - jobs: changelog: uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main with: - changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/metricflow/blob/main/CONTRIBUTING.md).' + changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, + see [the contributing guide](https://github.com/dbt-labs/metricflow/blob/main/CONTRIBUTING.md).' skip_label: 'Skip Changelog' secrets: inherit diff --git a/.github/workflows/changelog-validation.yaml b/.github/workflows/changelog-validation.yaml index 22b0684fc9..8b12994389 100644 --- a/.github/workflows/changelog-validation.yaml +++ b/.github/workflows/changelog-validation.yaml @@ -14,14 +14,12 @@ on: - edited - reopened - synchronize - jobs: check_batch: name: Check Batch runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Run `changie batch` uses: miniscruff/changie-action@v2 with: diff --git a/.github/workflows/ci-cache-environments.yaml b/.github/workflows/ci-cache-environments.yaml index c709ccb961..07f5694522 100644 --- a/.github/workflows/ci-cache-environments.yaml +++ b/.github/workflows/ci-cache-environments.yaml @@ -7,7 +7,6 @@ on: branches: - 'main' jobs: - cache-python-environments: name: Cache Python Environments runs-on: ubuntu-latest @@ -17,7 +16,6 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - name: Cache Python ${{ matrix.python-version }} Environment uses: ./.github/actions/setup-python-env with: @@ -25,6 +23,9 @@ jobs: cache-pre-commit-environment: true hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "dev-env"}, {"hatch_project_directory": ".", "hatch_environment_name": "postgres-env"}, diff --git a/.github/workflows/ci-metricflow-unit-tests.yaml b/.github/workflows/ci-metricflow-unit-tests.yaml index 6c691a7dd3..572f65682a 100644 --- a/.github/workflows/ci-metricflow-unit-tests.yaml +++ b/.github/workflows/ci-metricflow-unit-tests.yaml @@ -8,7 +8,6 @@ on: - reopened - synchronize jobs: - metricflow-unit-tests-duckdb: name: MetricFlow Tests (DuckDB) runs-on: ubuntu-latest @@ -18,12 +17,10 @@ jobs: steps: - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: python-version: ${{ matrix.python-version }} make-target: "test-include-slow" - metricflow-unit-tests-postgres: name: MetricFlow Tests (PostgreSQL) runs-on: ubuntu-latest @@ -35,27 +32,24 @@ jobs: POSTGRES_PASSWORD: metricflowing POSTGRES_DB: metricflow options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 5432:5432 steps: - - name: Check-out the repo uses: actions/checkout@v4 - - uses: ./.github/actions/run-mf-tests with: make-target: "test-postgresql" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "postgres-env"} ] } - metricflow-unit-tests: # This step is used to simplify setup for branch protection. Branch protection is configured to check if this step # fails vs. checking all test steps. @@ -64,32 +58,30 @@ jobs: if: ${{ always() }} needs: [metricflow-unit-tests-duckdb, metricflow-unit-tests-postgres] steps: - - name: Check success run: test ${{ needs.metricflow-unit-tests-duckdb.result }} = 'success' -a ${{ needs.metricflow-unit-tests-postgres.result }} = 'success' - metricflow-package-tests: name: MetricFlow Packages Tests runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.9", "3.12" ] + python-version: ["3.9", "3.12"] steps: - - name: Check-out the repo uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python-version }} Environment uses: ./.github/actions/setup-python-env with: python-version: "${{ matrix.python-version }}" hatch-environment-cache-config-json: >- { + + + "configs": [ {"hatch_project_directory": ".", "hatch_environment_name": "dev-env"}, {"hatch_project_directory": "./metricflow-semantics", "hatch_environment_name": "dev-env"} ] } - - name: Run Package-Build Tests run: "make test-build-packages" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80c4e1d4d5..fc66794179 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,33 +1,30 @@ # Exclude snapshots as they can represent specific output and formatting hooks may strip newlines. -exclude: '^(?:tests_metricflow|tests_metricflow_semantics)/snapshots/.*$' +exclude: ^(?:tests_metricflow|tests_metricflow_semantics)/snapshots/.*$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - - id: check-json - - id: trailing-whitespace - exclude_types: - - "markdown" - - id: end-of-file-fixer - - id: check-case-conflict - - # Faster version of flake8 / isort / etc. - # Uses ruff.toml for configuration. + - id: check-json + - id: trailing-whitespace + exclude_types: + - markdown + - id: end-of-file-fixer + - id: check-case-conflict + # Faster version of flake8 / isort / etc. + # Uses ruff.toml for configuration. - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.3.3' + rev: v0.3.3 hooks: - - id: ruff - verbose: true - args: [--fix, --exit-non-zero-on-fix] - + - id: ruff + verbose: true + args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black rev: 23.3.0 hooks: - - id: black - verbose: true - args: ["--line-length", "120"] - - # Uses mypy.ini for configuration. + - id: black + verbose: true + args: [--line-length, '120'] + # Uses mypy.ini for configuration. - repo: https://github.com/pre-commit/mirrors-mypy # Note: with "language: system", this version is unrelated to what's run. rev: v1.3.0 @@ -39,9 +36,14 @@ repos: # pre-commit. This is set for mypy to use the specified package dependencies in Hatch (assuming pre-commit is # run with hatch run ...). Seems like pre-commit calls the mypy on the command line with this settings. language: system - - repo: https://github.com/rhysd/actionlint rev: v1.7.6 hooks: - id: actionlint files: ^\.github/workflows/ + # YAML formatter + - repo: https://github.com/google/yamlfmt + rev: v0.19.0 + hooks: + - id: yamlfmt + verbose: true diff --git a/.yamlfmt b/.yamlfmt new file mode 100644 index 0000000000..c718cff923 --- /dev/null +++ b/.yamlfmt @@ -0,0 +1,8 @@ +formatter: + type: basic + retain_line_breaks: true + max_line_length: 150 + scan_folded_as_literal: true + indentless_arrays: false + drop_merge_tag: false + pad_line_comments: 1 diff --git a/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/dbt_project.yml b/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/dbt_project.yml index a69fbafdf9..4396bf4acf 100644 --- a/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/dbt_project.yml +++ b/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/dbt_project.yml @@ -1,8 +1,6 @@ name: mf_tutorial_project version: 1.0.0 config-version: 2 - profile: mf_tutorial - model-paths: ["models"] seed-paths: ["seeds"] diff --git a/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/models/_models.yml b/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/models/_models.yml index 402775aab1..dbfdcba02f 100644 --- a/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/models/_models.yml +++ b/dbt-metricflow/dbt_metricflow/cli/mf_tutorial_project/models/_models.yml @@ -1,11 +1,10 @@ # See: https://docs.getdbt.com/docs/build/metricflow-time-spine # For the page above, be sure to select the correct version of dbt at the top. - models: - name: all_days description: A time spine with one row per day. time_spine: - standard_granularity_column: date_day # Column for the standard grain of your table + standard_granularity_column: date_day # Column for the standard grain of your table columns: - name: date_day - granularity: day # Set the granularity of the column + granularity: day # Set the granularity of the column diff --git a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/metrics.yml b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/metrics.yml index c83f56ac67..e7ef244134 100644 --- a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/metrics.yml +++ b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/metrics.yml @@ -1,4 +1,3 @@ ---- metrics: - name: new_customers type: SIMPLE diff --git a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/saved_queries.yml b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/saved_queries.yml index c13b2dadbf..e3ef21ba8e 100644 --- a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/saved_queries.yml +++ b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/saved_queries.yml @@ -1,4 +1,3 @@ ---- saved_queries: - name: core_transaction_metrics description: Important transaction metrics. diff --git a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/transactions.yml b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/transactions.yml index 82d780efb8..aefbd64260 100644 --- a/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/transactions.yml +++ b/dbt-metricflow/dbt_metricflow/cli/sample_dbt_models/sample_models/transactions.yml @@ -28,8 +28,7 @@ semantic_models: expr: "1" agg: SUM - name: quick_buy_amount_usd - description: The total USD value of the transactions that were - purchased using the "quick buy" button. + description: The total USD value of the transactions that were purchased using the "quick buy" button. expr: CASE WHEN transaction_type_name = 'quick-buy' THEN transaction_amount_usd ELSE 0 END agg: SUM - name: quick_buy_transactions @@ -37,13 +36,11 @@ semantic_models: expr: CASE WHEN transaction_type_name = 'quick-buy' THEN TRUE ELSE FALSE END agg: SUM_BOOLEAN - name: cancellations_usd - description: The total USD value of the transactions that were - cancelled. + description: The total USD value of the transactions that were cancelled. expr: CASE WHEN transaction_type_name = 'cancellation' THEN transaction_amount_usd ELSE 0 END agg: SUM - name: alterations_usd - description: The total USD value of the transactions that were - altered. + description: The total USD value of the transactions that were altered. expr: CASE WHEN transaction_type_name = 'alteration' THEN transaction_amount_usd ELSE 0 END agg: SUM - name: transacting_customers diff --git a/local-data-warehouses/postgresql/docker-compose.yaml b/local-data-warehouses/postgresql/docker-compose.yaml index 9641eddc31..48bbf6f576 100644 --- a/local-data-warehouses/postgresql/docker-compose.yaml +++ b/local-data-warehouses/postgresql/docker-compose.yaml @@ -1,5 +1,4 @@ version: "3.7" - services: postgres: container_name: postgres diff --git a/local-data-warehouses/trino/docker-compose.yaml b/local-data-warehouses/trino/docker-compose.yaml index 64ca264355..5337a52a74 100644 --- a/local-data-warehouses/trino/docker-compose.yaml +++ b/local-data-warehouses/trino/docker-compose.yaml @@ -1,5 +1,4 @@ version: "3.7" - services: trino: container_name: trino diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/metrics.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/metrics.yaml index 7331867ada..cd0b69103d 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/metrics.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: "bookings" description: "bookings metric" @@ -66,7 +65,7 @@ metric: type_params: measure: name: average_booking_value - filter: "{{ Dimension('booking__is_instant') }}" + filter: "{{ Dimension('booking__is_instant') }}" --- metric: name: "booking_value_for_non_null_listing_id" diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml index efce1c6a1e..889372428a 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml @@ -1,4 +1,3 @@ ---- project_configuration: time_spine_table_configurations: - location: example_schema.example_table diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/saved_queries.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/saved_queries.yaml index 36af31d672..2ba310172d 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/saved_queries.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/saved_queries.yaml @@ -1,4 +1,3 @@ ---- saved_query: name: p0_booking description: Booking-related metrics that are of the highest priority. @@ -32,7 +31,6 @@ saved_query: - Metric('listings').descending(True) - TimeDimension('metric_time', 'day') limit: 10 - exports: - name: highly_active_listings config: diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/accounts_source.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/accounts_source.yaml index 6803284076..5d91522546 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/accounts_source.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/accounts_source.yaml @@ -1,21 +1,16 @@ ---- semantic_model: name: accounts_source description: accounts_source label: Accounts Source - node_relation: schema_name: $source_schema alias: fct_accounts - defaults: agg_time_dimension: ds - measures: - name: account_balance agg: sum label: Account Balance - - name: total_account_balance_first_day agg: sum label: Total Account Balance on First Day @@ -23,7 +18,6 @@ semantic_model: non_additive_dimension: name: ds window_choice: min - - name: current_account_balance_by_user agg: sum label: Current Account Banance by User @@ -33,7 +27,6 @@ semantic_model: window_choice: max window_groupings: - user - dimensions: - name: ds type: time @@ -43,9 +36,7 @@ semantic_model: - name: account_type type: categorical label: Account Type - primary_entity: account - entities: - name: user type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_monthly.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_monthly.yaml index dc049a7078..f4f53c8c99 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_monthly.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_monthly.yaml @@ -1,28 +1,21 @@ ---- semantic_model: name: bookings_monthly description: bookings_monthly - node_relation: schema_name: $source_schema alias: fct_bookings - defaults: agg_time_dimension: ds - measures: - name: monthly_bookings expr: "1" agg: sum - dimensions: - name: ds type: time type_params: time_granularity: month - primary_entity: monthly_booking - entities: - name: listing type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_source.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_source.yaml index 98a3d883f7..59a65c241c 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_source.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: bookings_source description: bookings_source - node_relation: schema_name: $source_schema alias: fct_bookings - defaults: agg_time_dimension: ds - measures: - name: bookings expr: "1" @@ -65,7 +61,6 @@ semantic_model: percentile: 0.99 use_discrete_percentile: true use_approximate_percentile: true - dimensions: - name: is_instant type: categorical @@ -82,9 +77,7 @@ semantic_model: type: time type_params: time_granularity: day - primary_entity: booking - entities: - name: listing type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_yearly.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_yearly.yaml index 3c36bbe16a..18f0de9a73 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_yearly.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/bookings_yearly.yaml @@ -1,28 +1,21 @@ ---- semantic_model: name: bookings_yearly description: bookings_yearly - node_relation: schema_name: $source_schema alias: fct_bookings - defaults: agg_time_dimension: ds - measures: - name: yearly_bookings expr: "1" agg: sum - dimensions: - name: ds type: time type_params: time_granularity: year - primary_entity: yearly_booking - entities: - name: listing type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/companies.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/companies.yaml index fa7cf22cc6..dfe39557ee 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/companies.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/companies.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: companies description: If a user is a company / business, this defines the mapping. - node_relation: schema_name: $source_schema alias: dim_companies - dimensions: - name: company_name type: categorical - entities: - name: company type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/id_verifications.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/id_verifications.yaml index 1fb9b4f524..213bda1e64 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/id_verifications.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/id_verifications.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: id_verifications description: id_verifications - node_relation: schema_name: $source_schema alias: fct_id_verifications - defaults: agg_time_dimension: ds - measures: - name: identity_verifications expr: "1" agg: sum - dimensions: - name: ds type: time @@ -27,7 +22,6 @@ semantic_model: time_granularity: day - name: verification_type type: categorical - entities: - name: verification type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/listings_latest.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/listings_latest.yaml index c14800050e..1e376356bb 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/listings_latest.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/listings_latest.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: listings_latest description: listings_latest - node_relation: schema_name: $source_schema alias: dim_listings_latest - defaults: agg_time_dimension: ds - measures: - name: listings expr: 1 @@ -20,7 +16,6 @@ semantic_model: - name: smallest_listing expr: capacity agg: min - dimensions: - name: ds type: time @@ -40,7 +35,6 @@ semantic_model: - name: capacity_latest type: categorical expr: capacity - entities: - name: listing type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/lux_listing_mapping.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/lux_listing_mapping.yaml index 30dd2ab624..f1c73bed14 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/lux_listing_mapping.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/lux_listing_mapping.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: lux_listing_mapping description: lux_listing_mapping - node_relation: schema_name: $source_schema alias: dim_lux_listing_id_mapping - entities: - name: listing type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/no_measures_source.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/no_measures_source.yaml index 931d0712bd..10a53f8a2c 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/no_measures_source.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/no_measures_source.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: no_measures_source description: no_measures_source label: No Measures Source - node_relation: schema_name: $source_schema alias: fct_accounts - defaults: agg_time_dimension: ds2 - dimensions: - name: ds2 type: time @@ -20,9 +16,7 @@ semantic_model: - name: account_type2 type: categorical label: Account Type2 - primary_entity: account - entities: - name: user type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/revenue.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/revenue.yaml index 6dc36a68c9..c5b63a735c 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/revenue.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/revenue.yaml @@ -1,29 +1,22 @@ ---- semantic_model: name: revenue description: revenue - node_relation: schema_name: $source_schema alias: fct_revenue - defaults: agg_time_dimension: ds - measures: - name: txn_revenue expr: revenue agg: sum - dimensions: - name: ds type: time expr: created_at type_params: time_granularity: day - primary_entity: end_of_day_revenue - entities: - name: user type: foreign diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/user_sm_source.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/user_sm_source.yaml index 74957ccc58..824f752111 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/user_sm_source.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/user_sm_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: users_ds_source description: users_ds_source - node_relation: schema_name: $source_schema alias: dim_users - defaults: agg_time_dimension: ds_source_date - dimensions: - name: ds_source_date type: time @@ -26,7 +22,6 @@ semantic_model: time_granularity: day - name: home_state type: categorical - entities: - name: user type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/users_latest.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/users_latest.yaml index d85c37b44b..26bdc07a48 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/users_latest.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/users_latest.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: users_latest description: users_latest - node_relation: schema_name: $source_schema alias: dim_users_latest - dimensions: - name: ds type: time @@ -14,7 +11,6 @@ semantic_model: time_granularity: day - name: home_state_latest type: categorical - entities: - name: user type: primary diff --git a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/views_source.yaml b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/views_source.yaml index a6cafa9a6b..c503110c9d 100644 --- a/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/views_source.yaml +++ b/metricflow-semantic-interfaces/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/semantic_models/views_source.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: views_source description: views_source - node_relation: schema_name: $source_schema alias: fct_views - defaults: agg_time_dimension: ds - measures: - name: views expr: "1" agg: sum - dimensions: - name: ds type: time @@ -25,7 +20,6 @@ semantic_model: is_partition: true type_params: time_granularity: day - entities: - name: listing type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/metrics.yaml index 5f7dff21e7..f947040a44 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: monthly_metric_0 description: A metric with a month grain. @@ -39,7 +38,6 @@ metric: metrics: - name: monthly_metric_0 - name: yearly_metric_0 - --- metric: name: metric_derived_from_heterogeneous_derived_metric @@ -51,7 +49,6 @@ metric: expr: derived_metric_with_different_parent_time_grains metrics: - name: derived_metric_with_different_parent_time_grains - --- metric: name: metric_derived_from_homogeneous_derived_metric diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/monthly_measures_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/monthly_measures_source.yaml index 605008fbdf..99a75dc1df 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/monthly_measures_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/monthly_measures_source.yaml @@ -1,25 +1,19 @@ ---- semantic_model: name: monthly_measures_source description: Contains measures with a month grain. - node_relation: schema_name: $source_schema alias: fct_monthly_measures - defaults: agg_time_dimension: creation_time - measures: - name: monthly_measure_0 agg: sum - name: monthly_measure_1 agg: sum - dimensions: - name: creation_time type: time type_params: time_granularity: month - primary_entity: monthly_measure_entity diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/yearly_measures_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/yearly_measures_source.yaml index 6097d4b0d4..a6647eed7f 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/yearly_measures_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/ambiguous_resolution_manifest/semantic_models/yearly_measures_source.yaml @@ -1,23 +1,17 @@ ---- semantic_model: name: yearly_measure_source description: Contains measures with a year grain. - node_relation: schema_name: $source_schema alias: fct_yearly_measures - defaults: agg_time_dimension: creation_time - measures: - name: yearly_measure_0 agg: sum - dimensions: - name: creation_time type: time type_params: time_granularity: year - primary_entity: yearly_measure_entity diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest.yaml index f5f5344894..8f35866581 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest.yaml @@ -1,21 +1,16 @@ ---- semantic_model: name: listings_latest description: listings_latest - node_relation: schema_name: $source_schema alias: dim_listings_latest - defaults: agg_time_dimension: ds - measures: - name: listings expr: 1 agg: sum create_metric: true - dimensions: - name: ds type: time @@ -25,7 +20,6 @@ semantic_model: - name: country_latest type: categorical expr: country - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest_cyclic.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest_cyclic.yaml index 70d715690d..3f1202fdf8 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest_cyclic.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/cyclic_join_manifest/listings_latest_cyclic.yaml @@ -1,17 +1,13 @@ ---- semantic_model: name: listings_latest_cyclic description: This can create a join cycle with listings_latest since they share primary / unique keys. - node_relation: schema_name: $source_schema alias: dim_listings_latest - dimensions: - name: capacity_latest type: categorical expr: capacity - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/data_warehouse_validation_manifest/semantic_models/semantic_model1.yml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/data_warehouse_validation_manifest/semantic_models/semantic_model1.yml index 677b39c657..1fb2290e1e 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/data_warehouse_validation_manifest/semantic_models/semantic_model1.yml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/data_warehouse_validation_manifest/semantic_models/semantic_model1.yml @@ -1,15 +1,11 @@ ---- semantic_model: name: animals description: If a user is a company / business, this defines the mapping. - node_relation: schema_name: $source_schema alias: fct_animals - defaults: agg_time_dimension: ds - dimensions: - name: ds type: time @@ -18,13 +14,11 @@ semantic_model: - name: is_dog type: categorical is_partition: True - measures: - name: count_dogs agg: sum expr: 1 create_metric: True - entities: - name: id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/metrics/monthly_bookings_to_daily_bookings_ratio.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/metrics/monthly_bookings_to_daily_bookings_ratio.yaml index ab4c1fcc76..d6090ca798 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/metrics/monthly_bookings_to_daily_bookings_ratio.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/metrics/monthly_bookings_to_daily_bookings_ratio.yaml @@ -1,4 +1,3 @@ ---- metric: name: monthly_bookings_to_daily_bookings description: Ratio of daily bookings that are included in the monthly bookings total as a derived metric. diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/bookings_monthly_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/bookings_monthly_source.yaml index 7832d348e5..6ecf921651 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/bookings_monthly_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/bookings_monthly_source.yaml @@ -1,30 +1,23 @@ ---- semantic_model: name: monthly_bookings_source description: > - Contains bookings by month. Temporarily renamed from `bookings_monthly_source` to trigger edge case for - skipped tests in `test_metric_lookup.py`. + Contains bookings by month. Temporarily renamed from `bookings_monthly_source` to trigger edge case for skipped tests in `test_metric_lookup.py`. node_relation: schema_name: $source_schema alias: fct_bookings_extended_monthly - defaults: agg_time_dimension: ds - measures: - name: bookings_monthly agg: sum create_metric: true - primary_entity: booking_monthly - dimensions: - name: ds type: time type_params: time_granularity: month - entities: - name: listing expr: listing_id diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/extended_bookings_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/extended_bookings_source.yaml index 1158cf5ad5..6f4d7c2d85 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/extended_bookings_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/extended_bookings_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: extended_bookings_source description: extended_bookings_source - node_relation: schema_name: $source_schema alias: fct_bookings_extended - defaults: agg_time_dimension: ds - measures: - name: bookings expr: "1" @@ -19,13 +15,11 @@ semantic_model: expr: listing_id agg: count_distinct create_metric: true - dimensions: - name: ds type: time type_params: time_granularity: day - entities: - name: booking expr: booking_id diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/listings_extended_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/listings_extended_source.yaml index 6b18edb526..21562cd18e 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/listings_extended_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/extended_date_manifest/semantic_models/listings_extended_source.yaml @@ -1,19 +1,15 @@ ---- semantic_model: name: listings_extended_source description: listings_extended_source - node_relation: schema_name: $source_schema alias: dim_listings_extended - dimensions: - name: ds expr: listing_creation_ds type: time type_params: time_granularity: day - entities: - name: listing expr: listing_id diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/bookings_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/bookings_source.yaml index 997011a54c..9feff979d2 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/bookings_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/bookings_source.yaml @@ -1,27 +1,21 @@ ---- semantic_model: name: bookings_source description: bookings_source - node_relation: schema_name: $source_schema alias: fct_bookings_for_joins - defaults: agg_time_dimension: ds - measures: - name: bookings expr: booking agg: sum create_metric: true - dimensions: - name: ds type: time type_params: time_granularity: day - primary_entity: booking entities: - name: listing diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/listings_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/listings_source.yaml index 498e2d3b83..272146b481 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/listings_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/join_types_manifest/listings_source.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: listings_source description: listings_source - node_relation: schema_name: $source_schema alias: dim_listings_for_joins - dimensions: - name: country type: categorical - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/account_month_txns.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/account_month_txns.yaml index 74dadf5b5a..72598e847e 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/account_month_txns.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/account_month_txns.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: account_month_txns description: account_month_txns - node_relation: schema_name: $source_schema alias: account_month_txns - defaults: agg_time_dimension: ds - measures: - name: txn_count agg: sum create_metric: true - dimensions: - name: ds type: time @@ -22,7 +17,6 @@ semantic_model: time_granularity: day - name: account_month type: categorical - entities: - name: account_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/bridge_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/bridge_table.yaml index 0f77d0cf3a..bac2de5fce 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/bridge_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/bridge_table.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: bridge_table description: bridge_table - node_relation: schema_name: $source_schema alias: bridge_table - dimensions: - name: extra_dim type: categorical - entities: - name: account_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_other_data.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_other_data.yaml index d1435446bc..45c4d6915c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_other_data.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_other_data.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: customer_other_data description: customer_other_data - node_relation: schema_name: $source_schema alias: customer_other_data - defaults: agg_time_dimension: acquired_ds - measures: - name: customers_with_other_data expr: 1 agg: sum - dimensions: - name: country type: categorical @@ -22,7 +17,6 @@ semantic_model: type: time type_params: time_granularity: day - entities: - name: customer_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_table.yaml index 94d9a72660..3ef62945df 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/customer_table.yaml @@ -1,18 +1,14 @@ ---- semantic_model: name: customer_table description: customer_table - node_relation: schema_name: $source_schema alias: customer_table - dimensions: - name: customer_name type: categorical - name: customer_atomic_weight type: categorical - entities: - name: customer_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/metrics.yaml index d9fd8ab009..1d67a6126c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: paraguayan_customers type: SIMPLE diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/third_hop_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/third_hop_table.yaml index 5051f263bb..8a302de32a 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/third_hop_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/multi_hop_join_manifest/third_hop_table.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: third_hop_table description: third_hop_table - node_relation: schema_name: $source_schema alias: third_hop_table - dimensions: - name: value type: categorical - entities: - name: customer_third_hop_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/bookings_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/bookings_source.yaml index a7581e4f5f..0be6507702 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/bookings_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/bookings_source.yaml @@ -1,21 +1,16 @@ ---- semantic_model: name: bookings_source description: bookings_source - node_relation: schema_name: $source_schema alias: fct_bookings_dt - defaults: agg_time_dimension: dt - measures: - name: bookings expr: "1" agg: sum create_metric: true - dimensions: - name: is_instant type: categorical @@ -23,9 +18,7 @@ semantic_model: type: time type_params: time_granularity: day - primary_entity: booking - entities: - name: listing type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/listings_latest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/listings_latest.yaml index b35b271750..466bd16158 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/listings_latest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/non_sm_manifest/listings_latest.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: listings_latest description: listings_latest - node_relation: schema_name: $source_schema alias: dim_listings_latest - defaults: agg_time_dimension: dt - measures: - name: listings expr: 1 agg: sum - dimensions: - name: dt type: time @@ -28,7 +23,6 @@ semantic_model: - name: country_latest type: categorical expr: country - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/account_month_txns.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/account_month_txns.yaml index 40c599a44f..7b39504c81 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/account_month_txns.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/account_month_txns.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: account_month_txns description: account_month_txns - node_relation: schema_name: $source_schema alias: account_month_txns - defaults: agg_time_dimension: ds - measures: - name: txn_count agg: sum create_metric: true - dimensions: - name: ds_partitioned type: time @@ -27,7 +22,6 @@ semantic_model: time_granularity: day - name: account_month type: categorical - entities: - name: account_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/bridge_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/bridge_table.yaml index c131de2268..4fc0aff8c6 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/bridge_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/bridge_table.yaml @@ -1,21 +1,16 @@ ---- semantic_model: name: bridge_table description: bridge_table - node_relation: schema_name: $source_schema alias: bridge_table - defaults: agg_time_dimension: ds_partitioned - measures: - name: account_customer_combos expr: account_id || customer_id agg: count_distinct create_metric: true - dimensions: - name: extra_dim type: categorical @@ -24,9 +19,7 @@ semantic_model: type_params: time_granularity: day is_partition: true - primary_entity: bridge_account - entities: - name: account_id type: unique diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_other_data.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_other_data.yaml index d1435446bc..45c4d6915c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_other_data.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_other_data.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: customer_other_data description: customer_other_data - node_relation: schema_name: $source_schema alias: customer_other_data - defaults: agg_time_dimension: acquired_ds - measures: - name: customers_with_other_data expr: 1 agg: sum - dimensions: - name: country type: categorical @@ -22,7 +17,6 @@ semantic_model: type: time type_params: time_granularity: day - entities: - name: customer_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_table.yaml index c2f6b4805e..60b8fd2782 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/customer_table.yaml @@ -1,22 +1,16 @@ ---- semantic_model: name: customer_table description: customer_table - node_relation: schema_name: $source_schema alias: customer_table - - defaults: agg_time_dimension: ds_partitioned - measures: - name: customers expr: 1 agg: sum create_metric: true - dimensions: - name: customer_name type: categorical @@ -27,7 +21,6 @@ semantic_model: type_params: time_granularity: day is_partition: true - entities: - name: customer_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/metrics.yaml index d9fd8ab009..1d67a6126c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: paraguayan_customers type: SIMPLE diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/third_hop_table.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/third_hop_table.yaml index b808e6e71b..ba12872ee5 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/third_hop_table.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/partitioned_multi_hop_join_manifest/third_hop_table.yaml @@ -1,21 +1,16 @@ ---- semantic_model: name: third_hop_table description: third_hop_table - node_relation: schema_name: $source_schema alias: third_hop_table - defaults: agg_time_dimension: third_hop_ds - measures: - name: third_hop_count expr: customer_third_hop_id agg: count_distinct create_metric: true - dimensions: - name: value type: categorical @@ -23,7 +18,6 @@ semantic_model: type: time type_params: time_granularity: day - entities: - name: customer_third_hop_id type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/non_scd_companies.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/non_scd_companies.yaml index 45c941111b..ce844a7240 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/non_scd_companies.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/non_scd_companies.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: companies description: If a user is a company / business, this defines the mapping. - node_relation: schema_name: $source_schema alias: dim_companies - dimensions: - name: company_name type: categorical - entities: - name: company type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_accounts.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_accounts.yaml index 6753051366..a925277a5a 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_accounts.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_accounts.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: primary_accounts description: SCD Type II table of primary account history - node_relation: schema_name: $source_schema alias: dim_primary_accounts - dimensions: - name: primary_from type: time @@ -24,9 +21,7 @@ semantic_model: is_end: True - name: account_type type: categorical - primary_entity: scd_user - entities: - name: user type: natural diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_bookings.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_bookings.yaml index 2d92e3820d..8d3e0e2281 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_bookings.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_bookings.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: bookings_source description: bookings semantic model for use in the SCD model - node_relation: schema_name: $source_schema alias: fct_bookings - defaults: agg_time_dimension: ds - measures: - name: bookings expr: "1" @@ -29,7 +25,6 @@ semantic_model: expr: booking_value agg: sum agg_time_dimension: paid_at - dimensions: - name: is_instant type: categorical @@ -46,9 +41,7 @@ semantic_model: type: time type_params: time_granularity: day - primary_entity: booking - entities: - name: listing type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_listings.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_listings.yaml index 921250af65..9ca5924274 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_listings.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_listings.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: listings description: SCD Type II table of listings history - node_relation: schema_name: $source_schema alias: dim_listings - dimensions: - name: window_start type: time @@ -28,9 +25,7 @@ semantic_model: type: categorical - name: capacity type: categorical - primary_entity: listing - entities: - name: listing type: natural diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_lux_listings.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_lux_listings.yaml index dad7dce6d2..072dabfc78 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_lux_listings.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_lux_listings.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: lux_listing_mapping description: Mapping from listing_id to lux_listing_id - node_relation: schema_name: $source_schema alias: dim_lux_listing_id_mapping - entities: - name: listing type: primary @@ -18,11 +15,9 @@ semantic_model: semantic_model: name: lux_listings description: SCD Type II table of lux listings history - node_relation: schema_name: $source_schema alias: dim_lux_listings - dimensions: - name: window_start type: time @@ -40,9 +35,7 @@ semantic_model: is_end: True - name: is_confirmed_lux type: categorical - primary_entity: lux_listing - entities: - name: lux_listing type: natural diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_metrics.yaml index e0c33ae900..481f8f07a7 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: bookings description: raw booking count @@ -10,8 +9,7 @@ metric: name: family_bookings description: Bookings of units with capacity for more than 2 people. type: SIMPLE - filter: - "{{ Dimension('listing__capacity') }} > 2" + filter: "{{ Dimension('listing__capacity') }} > 2" type_params: measure: bookings --- @@ -19,7 +17,6 @@ metric: name: potentially_lux_bookings description: raw booking count for listings that are lux, or unknown type: SIMPLE - filter: - "{{ Dimension('listing__is_lux') }} OR {{ Dimension('listing__is_lux') }} IS NULL" + filter: "{{ Dimension('listing__is_lux') }} OR {{ Dimension('listing__is_lux') }} IS NULL" type_params: measure: bookings diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_users.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_users.yaml index d85c37b44b..26bdc07a48 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_users.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/scd_manifest/scd_users.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: users_latest description: users_latest - node_relation: schema_name: $source_schema alias: dim_users_latest - dimensions: - name: ds type: time @@ -14,7 +11,6 @@ semantic_model: time_granularity: day - name: home_state_latest type: categorical - entities: - name: user type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_00_minimal_manifest/manifest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_00_minimal_manifest/manifest.yaml index 4eb4d32511..a60a718ef4 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_00_minimal_manifest/manifest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_00_minimal_manifest/manifest.yaml @@ -1,30 +1,23 @@ # Manifest containing the minimal number of elements. ---- semantic_model: name: bookings_source - node_relation: schema_name: $source_schema alias: bookings_source - defaults: agg_time_dimension: booking_time - entities: - name: booking type: primary - measures: - name: booking_count expr: "1" agg: sum - dimensions: - name: booking_time type: time type_params: time_granularity: quarter - --- metric: name: bookings diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/manifest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/manifest.yaml index 4c81796038..4c0606eea4 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/manifest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/manifest.yaml @@ -1,48 +1,37 @@ # Minimal manifest that contains 2 semantic models that can be joined via a foreign / primary relationship. ---- semantic_model: name: bookings_source - node_relation: schema_name: $source_schema alias: bookings_source - defaults: agg_time_dimension: booking_time - entities: - name: booking type: primary - name: listing type: foreign - measures: - name: booking_count expr: "1" agg: sum - dimensions: - name: booking_time type: time type_params: time_granularity: quarter - --- semantic_model: name: listings_source - node_relation: schema_name: $source_schema alias: listings_source - entities: - name: listing type: primary - dimensions: - name: country_latest type: categorical - --- metric: name: bookings diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/project_configuration.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/project_configuration.yaml index 1056954299..78d2afb4c4 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/project_configuration.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_02_single_join/project_configuration.yaml @@ -1,4 +1,3 @@ ---- project_configuration: time_spine_table_configurations: - location: $source_schema.mf_time_spine diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/manifest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/manifest.yaml index 8a592590c8..0c4404ab0e 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/manifest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/manifest.yaml @@ -1,52 +1,40 @@ # Minimal manifest containing derived metrics. ---- semantic_model: name: bookings_source - node_relation: schema_name: $source_schema alias: bookings_source - defaults: agg_time_dimension: booking_time - entities: - name: booking type: primary - measures: - name: booking_count expr: "1" agg: sum - dimensions: - name: booking_time type: time type_params: time_granularity: quarter - --- semantic_model: name: views_source - node_relation: schema_name: $source_schema alias: views_source - defaults: agg_time_dimension: view_time - measures: - name: view_count expr: "1" agg: sum - dimensions: - name: view_time type: time type_params: time_granularity: quarter - entities: - name: view type: primary @@ -58,14 +46,12 @@ metric: type: simple type_params: measure: booking_count - --- metric: name: views type: simple type_params: measure: view_count - --- metric: name: bookings_per_view diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/project_configuration.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/project_configuration.yaml index 1056954299..78d2afb4c4 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/project_configuration.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/sg_05_derived_metric/project_configuration.yaml @@ -1,4 +1,3 @@ ---- project_configuration: time_spine_table_configurations: - location: $source_schema.mf_time_spine diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/shared/project_configuration.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/shared/project_configuration.yaml index 96df913ae6..8531a90841 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/shared/project_configuration.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/shared/project_configuration.yaml @@ -1,4 +1,3 @@ ---- # Note: This file may be symlinked. project_configuration: time_spine_table_configurations: diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/metrics.yaml index 8baaa0ab3e..1ac97bbc54 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: "bookings" description: "bookings metric" @@ -55,7 +54,7 @@ metric: type: simple type_params: measure: average_booking_value - filter: "{{ Dimension('booking__is_instant') }}" + filter: "{{ Dimension('booking__is_instant') }}" --- metric: name: "booking_value_for_non_null_listing_id" @@ -245,7 +244,6 @@ metric: name: bookings denominator: name: booking_value - --- metric: name: "account_balance" @@ -253,7 +251,6 @@ metric: type: simple type_params: measure: account_balance - --- metric: name: "total_account_balance_first_day" diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/saved_queries.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/saved_queries.yaml index a89557847b..e31aa5221c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/saved_queries.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/saved_queries.yaml @@ -1,4 +1,3 @@ ---- saved_query: name: p0_booking description: Booking-related metrics that are of the highest priority. diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/accounts_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/accounts_source.yaml index 4a9b5e5131..913e518d65 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/accounts_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/accounts_source.yaml @@ -1,26 +1,20 @@ ---- semantic_model: name: accounts_source description: accounts_source - node_relation: schema_name: $source_schema alias: fct_accounts - defaults: agg_time_dimension: ds - measures: - name: account_balance agg: sum - - name: total_account_balance_first_day agg: sum expr: account_balance non_additive_dimension: name: ds window_choice: min - - name: current_account_balance_by_user agg: sum expr: account_balance @@ -29,7 +23,6 @@ semantic_model: window_choice: max window_groupings: - user - - name: total_account_balance_first_day_of_month agg: sum expr: account_balance @@ -38,7 +31,6 @@ semantic_model: name: ds_month window_choice: min create_metric: true - dimensions: - name: ds type: time @@ -51,9 +43,7 @@ semantic_model: time_granularity: month - name: account_type type: categorical - primary_entity: account - entities: - name: user type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/bookings_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/bookings_source.yaml index b180065d1c..c6f91e4318 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/bookings_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/bookings_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: bookings_source description: bookings_source - node_relation: schema_name: $source_schema alias: fct_bookings - defaults: agg_time_dimension: ds - measures: - name: bookings expr: "1" @@ -65,8 +61,6 @@ semantic_model: percentile: 0.99 use_discrete_percentile: true use_approximate_percentile: true - - dimensions: - name: is_instant type: categorical @@ -83,9 +77,7 @@ semantic_model: type: time type_params: time_granularity: day - primary_entity: booking - entities: - name: listing type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/buys_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/buys_source.yaml index 6aa6601f6a..bfa6697840 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/buys_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/buys_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: buys_source description: buys_source - node_relation: schema_name: $source_schema alias: fct_buys - defaults: agg_time_dimension: ds - measures: - name: buys expr: 1 @@ -21,7 +17,6 @@ semantic_model: - name: buyers expr: user_id agg: count_distinct - dimensions: - name: ds type: time @@ -31,9 +26,7 @@ semantic_model: type: time type_params: time_granularity: month - primary_entity: buy - entities: - name: user type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/companies.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/companies.yaml index 45c941111b..ce844a7240 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/companies.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/companies.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: companies description: If a user is a company / business, this defines the mapping. - node_relation: schema_name: $source_schema alias: dim_companies - dimensions: - name: company_name type: categorical - entities: - name: company type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/id_verifications.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/id_verifications.yaml index e6303afe46..58f44d5752 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/id_verifications.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/id_verifications.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: id_verifications description: id_verifications - node_relation: schema_name: $source_schema alias: fct_id_verifications - defaults: agg_time_dimension: ds - measures: - name: identity_verifications expr: "1" agg: sum - dimensions: - name: ds type: time @@ -27,7 +22,6 @@ semantic_model: time_granularity: day - name: verification_type type: categorical - entities: - name: verification type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/listings_latest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/listings_latest.yaml index c14800050e..1e376356bb 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/listings_latest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/listings_latest.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: listings_latest description: listings_latest - node_relation: schema_name: $source_schema alias: dim_listings_latest - defaults: agg_time_dimension: ds - measures: - name: listings expr: 1 @@ -20,7 +16,6 @@ semantic_model: - name: smallest_listing expr: capacity agg: min - dimensions: - name: ds type: time @@ -40,7 +35,6 @@ semantic_model: - name: capacity_latest type: categorical expr: capacity - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/lux_listing_mapping.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/lux_listing_mapping.yaml index 30dd2ab624..f1c73bed14 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/lux_listing_mapping.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/lux_listing_mapping.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: lux_listing_mapping description: lux_listing_mapping - node_relation: schema_name: $source_schema alias: dim_lux_listing_id_mapping - entities: - name: listing type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/revenue.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/revenue.yaml index 9183f12876..6046bd7325 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/revenue.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/revenue.yaml @@ -1,29 +1,22 @@ ---- semantic_model: name: revenue description: revenue - node_relation: schema_name: $source_schema alias: fct_revenue - defaults: agg_time_dimension: ds - measures: - name: txn_revenue expr: revenue agg: sum - dimensions: - name: ds type: time expr: created_at type_params: time_granularity: day - primary_entity: revenue_instance - entities: - name: user type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/user_sm_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/user_sm_source.yaml index 4e136051aa..eecf6ec4bc 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/user_sm_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/user_sm_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: users_ds_source description: users_ds_source - node_relation: schema_name: $source_schema alias: dim_users - defaults: agg_time_dimension: created_at - dimensions: - name: ds type: time @@ -42,13 +38,10 @@ semantic_model: type: time type_params: time_granularity: hour - - entities: - name: user type: primary expr: user_id - measures: - name: new_users expr: "1" diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/users_latest.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/users_latest.yaml index 44134d966b..38c1177168 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/users_latest.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/users_latest.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: users_latest description: users_latest - node_relation: schema_name: $source_schema alias: dim_users_latest - dimensions: - name: ds_latest type: time @@ -15,7 +12,6 @@ semantic_model: time_granularity: day - name: home_state_latest type: categorical - entities: - name: user type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/views_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/views_source.yaml index 4dd54c3942..07f7400b26 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/views_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/views_source.yaml @@ -1,20 +1,15 @@ ---- semantic_model: name: views_source description: views_source - node_relation: schema_name: $source_schema alias: fct_views - defaults: agg_time_dimension: ds - measures: - name: views expr: "1" agg: sum - dimensions: - name: ds type: time @@ -25,9 +20,7 @@ semantic_model: is_partition: true type_params: time_granularity: day - primary_entity: view - entities: - name: listing type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/visits_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/visits_source.yaml index 158314f25f..027bf14c23 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/visits_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_manifest/semantic_models/visits_source.yaml @@ -1,15 +1,11 @@ ---- semantic_model: name: visits_source description: visits_source - node_relation: schema_name: $source_schema alias: fct_visits - defaults: agg_time_dimension: ds - measures: - name: visits expr: 1 @@ -17,7 +13,6 @@ semantic_model: - name: visitors expr: user_id agg: count_distinct - dimensions: - name: ds type: time @@ -25,9 +20,7 @@ semantic_model: time_granularity: day - name: referrer_id type: categorical - primary_entity: visit - entities: - name: user type: foreign diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/all_entity_measure_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/all_entity_measure_source.yaml index 5d21bba583..2a9e73b182 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/all_entity_measure_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/all_entity_measure_source.yaml @@ -1,26 +1,20 @@ ---- semantic_model: name: all_entity_measure_source description: A measure source associated with ["entity_0", "entity_1", "entity_2"] - node_relation: schema_name: $source_schema alias: all_entity_measure_table - defaults: agg_time_dimension: ds - measures: - name: all_entity_measure agg: sum expr: "1" - dimensions: - name: ds type: time type_params: time_granularity: day - entities: - name: all_entity_composite type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_dimension_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_dimension_source.yaml index f9f3fa9476..2020185c28 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_dimension_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_dimension_source.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: entity_0_dimension_source description: Contains dimensions for "entity_0" - node_relation: schema_name: $source_schema alias: entity_0_dimension_table - dimensions: - name: country type: categorical - entities: - name: entity_0 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_measure_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_measure_source.yaml index 748e8cd2f5..9f92dd882a 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_measure_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_0_measure_source.yaml @@ -1,25 +1,19 @@ ---- semantic_model: name: entity_0_measure_source description: A measure source associated with "entity_0". - node_relation: schema_name: $source_schema alias: entity_0_measure_table - defaults: agg_time_dimension: ds - measures: - name: entity_0_measure agg: sum - dimensions: - name: ds type: time type_params: time_granularity: day - entities: - name: entity_0 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_source.yaml index 110bd5e4c1..9faac2cd42 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_source.yaml @@ -1,26 +1,20 @@ ---- semantic_model: name: entity_1_and_entity_2_measure_source description: A measure source associated with "entity_1" and "entity_2". - node_relation: schema_name: $source_schema alias: entity_1_and_entity_2_measure_table - defaults: agg_time_dimension: ds - measures: - name: entity_1_and_entity_2_measure agg: sum expr: "1" - dimensions: - name: ds type: time type_params: time_granularity: day - entities: - name: composite_entity type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_dimension_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_dimension_source.yaml index 2b047dd1d6..24daa9ddfb 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_dimension_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_dimension_source.yaml @@ -1,16 +1,12 @@ ---- semantic_model: name: entity_1_dimension_source description: Contains dimensions for "entity_1" - node_relation: schema_name: $source_schema alias: entity_1_dimension_table - dimensions: - name: country type: categorical - entities: - name: entity_1 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_measure_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_measure_source.yaml index a8ac26cbb0..389ae17c74 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_measure_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_measure_source.yaml @@ -1,25 +1,19 @@ ---- semantic_model: name: entity_1_measure_source description: A measure source associated with "entity_1". - node_relation: schema_name: $source_schema alias: entity_1_measure_table - defaults: agg_time_dimension: ds - measures: - name: entity_1_measure agg: sum - dimensions: - name: ds type: time type_params: time_granularity: day - entities: - name: entity_1 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_source.yaml index 03494732b4..0d045adea9 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_source.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: entity_1_to_entity_0_mapping_source description: Maps "entity_1" to "entity_0" - node_relation: schema_name: $source_schema alias: entity_1_to_entity_0_mapping_table - entities: - name: entity_1 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_source.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_source.yaml index 7a8c8ac5f5..3efbea422c 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_source.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_source.yaml @@ -1,12 +1,9 @@ ---- semantic_model: name: entity_2_to_entity_0_mapping_source description: Maps "entity_2" to "entity_0" - node_relation: schema_name: $source_schema alias: entity_2_to_entity_0_mapping_table - entities: - name: entity_2 type: primary diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/metrics.yaml b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/metrics.yaml index 354dfef919..8021e40f3d 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/metrics.yaml +++ b/metricflow-semantics/metricflow_semantics/test_helpers/semantic_manifest_yamls/simple_multi_hop_join_manifest/metrics.yaml @@ -1,4 +1,3 @@ ---- metric: name: entity_0_metric description: Metric based on a measure defined with "entity_0". diff --git a/tests_metricflow/cli/demo_data_types_project_add_on/models/demo_data_types.yml b/tests_metricflow/cli/demo_data_types_project_add_on/models/demo_data_types.yml index 55acc399de..77d419288b 100644 --- a/tests_metricflow/cli/demo_data_types_project_add_on/models/demo_data_types.yml +++ b/tests_metricflow/cli/demo_data_types_project_add_on/models/demo_data_types.yml @@ -4,7 +4,6 @@ semantic_models: defaults: agg_time_dimension: ds model: ref('demo_data_types') - measures: - name: demo_measure expr: 1 diff --git a/tests_metricflow/cli/demo_data_types_project_add_on/models/metrics.yml b/tests_metricflow/cli/demo_data_types_project_add_on/models/metrics.yml index 28366851ec..c7cb18214f 100644 --- a/tests_metricflow/cli/demo_data_types_project_add_on/models/metrics.yml +++ b/tests_metricflow/cli/demo_data_types_project_add_on/models/metrics.yml @@ -1,4 +1,3 @@ ---- metrics: - name: demo_metric type: SIMPLE diff --git a/tests_metricflow/fixtures/dbt_projects/metricflow_testing/dbt_project.yml b/tests_metricflow/fixtures/dbt_projects/metricflow_testing/dbt_project.yml index 58ae881ad7..61ef4cec72 100644 --- a/tests_metricflow/fixtures/dbt_projects/metricflow_testing/dbt_project.yml +++ b/tests_metricflow/fixtures/dbt_projects/metricflow_testing/dbt_project.yml @@ -1,10 +1,8 @@ name: "metricflow_testing" version: "1.0.0" config-version: 2 - # This must be set as an environment variable in the test runner. profile: "{{ env_var('MF_TEST_ADAPTER_TYPE') }}" - # These configurations specify where dbt should look for different types of files. # The `model-paths` config, for example, states that models in this project can be # found in the "models/" directory. You probably won't need to change these! @@ -14,7 +12,6 @@ test-paths: ["tests"] seed-paths: ["seeds"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] - clean-targets: # directories to be removed by `dbt clean` - "target" - "dbt_packages" diff --git a/tests_metricflow/fixtures/dbt_projects/metricflow_testing/models/example/schema.yml b/tests_metricflow/fixtures/dbt_projects/metricflow_testing/models/example/schema.yml index 2a53081715..59e9defcc5 100644 --- a/tests_metricflow/fixtures/dbt_projects/metricflow_testing/models/example/schema.yml +++ b/tests_metricflow/fixtures/dbt_projects/metricflow_testing/models/example/schema.yml @@ -1,6 +1,4 @@ - version: 2 - models: - name: my_first_dbt_model description: "A starter dbt model" @@ -10,7 +8,6 @@ models: tests: - unique - not_null - - name: my_second_dbt_model description: "A starter dbt model" columns: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings.yaml index 6c58266e75..bc569d2cec 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: dim_listings column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings_latest.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings_latest.yaml index cedf908e08..9b9d920366 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings_latest.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_listings_latest.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: dim_listings_latest column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_users.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_users.yaml index 430b76b49c..ac528d2e73 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_users.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_model/dim_users.yaml @@ -19,17 +19,28 @@ table_snapshot: type: TIME - name: archived_at type: TIME - rows: - - ["2020-01-01", "2020-01-01", "2019-03-03", "u0004114", "CA", "2020-01-01 00:00:00.000", "2020-01-01 00:00:00", "2020-01-01 00:00:00", "2020-01-01 01:00:00"] - - ["2020-01-01", "2020-01-01", "2019-04-03", "u1612112", "CA", "2020-01-01 00:00:00.001", "2020-01-01 00:00:01", "2020-01-01 00:01:00", "2020-01-01 02:00:00"] - - ["2020-01-01", "2020-01-01", "2017-03-03", "u0005432", "TX", "2020-01-01 00:00:00.002", "2020-01-01 00:00:02", "2020-01-01 00:02:00", "2020-01-01 03:00:00"] - - ["2020-01-01", "2020-01-01", "2013-03-03", "u0003452", "HI", "2020-01-01 00:00:00.003", "2020-01-01 00:00:03", "2020-01-01 00:03:00", "2020-01-01 04:00:00"] - - ["2020-01-01", "2020-01-01", "2014-03-03", "u0003154", "MD", "2020-01-01 00:00:00.004", "2020-01-01 00:00:04", "2020-01-01 00:04:00", "2020-01-01 05:00:00"] - - ["2020-01-01", "2020-01-01", "2015-03-03", "u0003141", "NY", "2020-01-01 00:00:00.005", "2020-01-01 00:00:05", "2020-01-01 00:05:00", "2020-01-01 06:00:00"] - - ["2020-01-02", "2020-01-02", "2019-03-03", "u0004114", "CA", "2020-01-01 00:00:00.006", "2020-01-01 00:00:06", "2020-01-01 00:06:00", "2020-01-01 07:00:00"] - - ["2020-01-02", "2020-01-02", "2019-04-03", "u1612112", "WA", "2020-01-01 00:00:00.007", "2020-01-01 00:00:07", "2020-01-01 00:07:00", "2020-01-01 08:00:00"] - - ["2020-01-02", "2020-01-02", "2017-03-03", "u0005432", "TX", "2020-01-01 00:00:00.008", "2020-01-01 00:00:08", "2020-01-01 00:08:00", "2020-01-01 09:00:00"] - - ["2020-01-02", "2020-01-02", "2013-03-03", "u0003452", "HI", "2020-01-01 00:00:00.009", "2020-01-01 00:00:09", "2020-01-01 00:09:00", "2020-01-01 10:00:00"] - - ["2020-01-02", "2020-01-02", "2014-03-03", "u0003154", "MD", "2020-01-01 00:00:00.010", "2020-01-01 00:00:10", "2020-01-01 00:10:00", "2020-01-01 11:00:00"] - - ["2020-01-02", "2020-01-02", "2015-03-03", "u0003141", "NY", "2020-01-01 00:00:00.011", "2020-01-01 00:00:11", "2020-01-01 00:11:00", "2020-01-01 12:00:00"] + - ["2020-01-01", "2020-01-01", "2019-03-03", "u0004114", "CA", "2020-01-01 00:00:00.000", "2020-01-01 00:00:00", "2020-01-01 00:00:00", "2020-01-01 + 01:00:00"] + - ["2020-01-01", "2020-01-01", "2019-04-03", "u1612112", "CA", "2020-01-01 00:00:00.001", "2020-01-01 00:00:01", "2020-01-01 00:01:00", "2020-01-01 + 02:00:00"] + - ["2020-01-01", "2020-01-01", "2017-03-03", "u0005432", "TX", "2020-01-01 00:00:00.002", "2020-01-01 00:00:02", "2020-01-01 00:02:00", "2020-01-01 + 03:00:00"] + - ["2020-01-01", "2020-01-01", "2013-03-03", "u0003452", "HI", "2020-01-01 00:00:00.003", "2020-01-01 00:00:03", "2020-01-01 00:03:00", "2020-01-01 + 04:00:00"] + - ["2020-01-01", "2020-01-01", "2014-03-03", "u0003154", "MD", "2020-01-01 00:00:00.004", "2020-01-01 00:00:04", "2020-01-01 00:04:00", "2020-01-01 + 05:00:00"] + - ["2020-01-01", "2020-01-01", "2015-03-03", "u0003141", "NY", "2020-01-01 00:00:00.005", "2020-01-01 00:00:05", "2020-01-01 00:05:00", "2020-01-01 + 06:00:00"] + - ["2020-01-02", "2020-01-02", "2019-03-03", "u0004114", "CA", "2020-01-01 00:00:00.006", "2020-01-01 00:00:06", "2020-01-01 00:06:00", "2020-01-01 + 07:00:00"] + - ["2020-01-02", "2020-01-02", "2019-04-03", "u1612112", "WA", "2020-01-01 00:00:00.007", "2020-01-01 00:00:07", "2020-01-01 00:07:00", "2020-01-01 + 08:00:00"] + - ["2020-01-02", "2020-01-02", "2017-03-03", "u0005432", "TX", "2020-01-01 00:00:00.008", "2020-01-01 00:00:08", "2020-01-01 00:08:00", "2020-01-01 + 09:00:00"] + - ["2020-01-02", "2020-01-02", "2013-03-03", "u0003452", "HI", "2020-01-01 00:00:00.009", "2020-01-01 00:00:09", "2020-01-01 00:09:00", "2020-01-01 + 10:00:00"] + - ["2020-01-02", "2020-01-02", "2014-03-03", "u0003154", "MD", "2020-01-01 00:00:00.010", "2020-01-01 00:00:10", "2020-01-01 00:10:00", "2020-01-01 + 11:00:00"] + - ["2020-01-02", "2020-01-02", "2015-03-03", "u0003141", "NY", "2020-01-01 00:00:00.011", "2020-01-01 00:00:11", "2020-01-01 00:11:00", "2020-01-01 + 12:00:00"] diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_bookings_dt.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_bookings_dt.yaml index e1fe39ed9e..f58c8f285c 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_bookings_dt.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_bookings_dt.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: fct_bookings_dt column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_views.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_views.yaml index 00ddd1b55f..6b3d6e3d2a 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_views.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_model/fct_views.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: fct_views column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/all_entity_measure_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/all_entity_measure_table.yaml index 3e6cab425f..1e88d7563e 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/all_entity_measure_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/all_entity_measure_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: all_entity_measure_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_dimension_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_dimension_table.yaml index 14c94ec76c..b297d51fb4 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_dimension_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_dimension_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_0_dimension_source column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_measure_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_measure_table.yaml index 3ae277435e..8c015212c4 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_measure_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_0_measure_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_0_measure_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_table.yaml index ae68711e10..ab2286fab2 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_and_entity_2_measure_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_1_and_entity_2_measure_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_dimension_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_dimension_table.yaml index 9a0258052f..6552a43228 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_dimension_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_dimension_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_1_dimension_source column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_measure_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_measure_table.yaml index 76bf0934e9..cb591ca1c8 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_measure_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_measure_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_1_measure_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_table.yaml index da03adb235..6c02d2079b 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_1_to_entity_0_mapping_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_1_to_entity_0_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_measure_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_measure_table.yaml index ecdc47d521..7120c641cd 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_measure_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_measure_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_2_measure_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_table.yaml b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_table.yaml index db4129ba34..037a2db57b 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_table.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/simple_multi_hop_join_manifest/entity_2_to_entity_0_mapping_table.yaml @@ -1,4 +1,3 @@ ---- table_snapshot: table_name: entity_2_to_entity_0_mapping_table column_definitions: diff --git a/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine.yaml b/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine.yaml index 42f5f59ed1..2e54f10759 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine.yaml @@ -9,7 +9,6 @@ table_snapshot: type: STRING - name: alien_day type: TIME - rows: - ["2000-01-01", "FQ4 2000", "FY 2000", "2020-01-01"] - ["2000-01-02", "FQ4 2000", "FY 2000", "2020-01-01"] diff --git a/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine_hour.yaml b/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine_hour.yaml index 6d9402f08d..b3c23ddbab 100644 --- a/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine_hour.yaml +++ b/tests_metricflow/fixtures/source_table_snapshots/time_spine_table/mf_time_spine_hour.yaml @@ -3,7 +3,6 @@ table_snapshot: column_definitions: - name: ts type: TIME - rows: - ["2019-12-28 00:00:00"] - ["2019-12-28 01:00:00"] diff --git a/tests_metricflow/integration/test_cases/itest_constraints.yaml b/tests_metricflow/integration/test_cases/itest_constraints.yaml index 99e89c925c..bed9c90c4f 100644 --- a/tests_metricflow/integration/test_cases/itest_constraints.yaml +++ b/tests_metricflow/integration/test_cases/itest_constraints.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: test_overlapping_constraint_dimensions description: Query a metric with a constraint that was requested as a dimension diff --git a/tests_metricflow/integration/test_cases/itest_conversion_metric.yaml b/tests_metricflow/integration/test_cases/itest_conversion_metric.yaml index 5f9b39ccf8..aa76325981 100644 --- a/tests_metricflow/integration/test_cases/itest_conversion_metric.yaml +++ b/tests_metricflow/integration/test_cases/itest_conversion_metric.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: conversion_rate_metric_infinite_window description: Query a conversion metric that calculates the conversion rate @@ -166,6 +165,7 @@ integration_test: b.referrer_id ) conversions ON opportunities.referrer_id = conversions.referrer_id + # TODO: the ordering logic is different in databricks which produces a different, but still correct answer. # --- # integration_test: diff --git a/tests_metricflow/integration/test_cases/itest_cumulative_metric.yaml b/tests_metricflow/integration/test_cases/itest_cumulative_metric.yaml index d76cc1e4f3..1a6ff46246 100644 --- a/tests_metricflow/integration/test_cases/itest_cumulative_metric.yaml +++ b/tests_metricflow/integration/test_cases/itest_cumulative_metric.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: windowed_cumulative_metric description: Query a cumulative metric that aggregates the last 2 months. @@ -348,6 +347,8 @@ integration_test: GROUP BY a.ds ORDER BY a.ds --- + + # TODO: Test is currently broken. #integration_test: # name: cumulative_metric_month_granularity diff --git a/tests_metricflow/integration/test_cases/itest_dimensions.yaml b/tests_metricflow/integration/test_cases/itest_dimensions.yaml index 154082ecb8..e092e7b40e 100644 --- a/tests_metricflow/integration/test_cases/itest_dimensions.yaml +++ b/tests_metricflow/integration/test_cases/itest_dimensions.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: multiple_dimensions description: Query one metric with multiple dimensions from different sources. @@ -149,7 +148,7 @@ integration_test: name: query_time_dimension_without_granularity description: Query just a time dimension, no granularity specified. Should assume default granularity for dimension. model: SIMPLE_MODEL - group_bys: [ "verification__ds"] + group_bys: ["verification__ds"] check_query: | SELECT v.ds as verification__ds__day @@ -161,7 +160,7 @@ integration_test: name: query_non_default_time_dimension_without_granularity description: Query just a time dimension, no granularity specified. Should assume default granularity for dimension. model: EXTENDED_DATE_MODEL - group_bys: [ "booking_monthly__ds"] + group_bys: ["booking_monthly__ds"] check_query: | SELECT ds AS booking_monthly__ds__month diff --git a/tests_metricflow/integration/test_cases/itest_dundered_identifiers.yaml b/tests_metricflow/integration/test_cases/itest_dundered_identifiers.yaml index c3c457309f..add91f3e3f 100644 --- a/tests_metricflow/integration/test_cases/itest_dundered_identifiers.yaml +++ b/tests_metricflow/integration/test_cases/itest_dundered_identifiers.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: one_hop_dundered_identifier description: Query a dimension from a different semantic model. Should match a left joined table query. diff --git a/tests_metricflow/integration/test_cases/itest_granularity.yaml b/tests_metricflow/integration/test_cases/itest_granularity.yaml index ba1ec7abc2..21215fe68b 100644 --- a/tests_metricflow/integration/test_cases/itest_granularity.yaml +++ b/tests_metricflow/integration/test_cases/itest_granularity.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: query_granularity_for_sum_day description: Query a sum metric by time granularities. @@ -315,7 +314,7 @@ integration_test: name: simple_metric_with_custom_granularity description: A simple metric queried with a custom granularity model: SIMPLE_MODEL - metrics: [ "bookings"] + metrics: ["bookings"] group_bys: ["booking__ds__alien_day"] check_query: | SELECT @@ -330,7 +329,7 @@ integration_test: name: simple_metric_with_custom_granularity_and_join description: A simple metric queried with a custom granularity model: SIMPLE_MODEL - metrics: [ "bookings"] + metrics: ["bookings"] group_bys: ["listing__ds__alien_day"] check_query: | SELECT @@ -347,7 +346,7 @@ integration_test: name: cumulative_metric_with_custom_granularity description: A cumulative metric queried with a custom granularity model: SIMPLE_MODEL - metrics: [ "trailing_2_months_revenue"] + metrics: ["trailing_2_months_revenue"] group_bys: ["metric_time__alien_day"] check_query: | SELECT @@ -377,7 +376,7 @@ integration_test: name: derived_offset_metric_with_custom_granularity description: A derived metric queried with a custom granularity model: SIMPLE_MODEL - metrics: [ "booking_fees_last_week_per_booker_this_week"] + metrics: ["booking_fees_last_week_per_booker_this_week"] group_bys: ["metric_time__alien_day"] check_query: | SELECT @@ -415,7 +414,7 @@ integration_test: name: multiple_metrics_with_custom_granularity description: A derived metric queried with a custom granularity model: SIMPLE_MODEL - metrics: [ "bookings", "listings"] + metrics: ["bookings", "listings"] group_bys: ["metric_time__alien_day", "listing__ds__month"] check_query: | SELECT diff --git a/tests_metricflow/integration/test_cases/itest_joins.yaml b/tests_metricflow/integration/test_cases/itest_joins.yaml index ce6aaafd07..e67d8f0308 100644 --- a/tests_metricflow/integration/test_cases/itest_joins.yaml +++ b/tests_metricflow/integration/test_cases/itest_joins.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: multiple_foreign_keys_guest description: Query a metric and the first of two foreign entities in the measure semantic model. diff --git a/tests_metricflow/integration/test_cases/itest_measure_aggregations.yaml b/tests_metricflow/integration/test_cases/itest_measure_aggregations.yaml index e3fc977427..89ddb3fb00 100644 --- a/tests_metricflow/integration/test_cases/itest_measure_aggregations.yaml +++ b/tests_metricflow/integration/test_cases/itest_measure_aggregations.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: max_agg description: Tests MAX aggregation. diff --git a/tests_metricflow/integration/test_cases/itest_measure_constraints.yaml b/tests_metricflow/integration/test_cases/itest_measure_constraints.yaml index d67ffea68f..7cf796f98a 100644 --- a/tests_metricflow/integration/test_cases/itest_measure_constraints.yaml +++ b/tests_metricflow/integration/test_cases/itest_measure_constraints.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: ratio_with_numerator_constraint_on_local_dimension description: | diff --git a/tests_metricflow/integration/test_cases/itest_metric_queries_no_dimensions.yaml b/tests_metricflow/integration/test_cases/itest_metric_queries_no_dimensions.yaml index 2a8c4bda14..d92127709f 100644 --- a/tests_metricflow/integration/test_cases/itest_metric_queries_no_dimensions.yaml +++ b/tests_metricflow/integration/test_cases/itest_metric_queries_no_dimensions.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: simple_query description: Tests selecting a metric with no group bys. @@ -74,4 +73,5 @@ integration_test: SUM(1) AS listings FROM {{ source_schema }}.dim_listings_latest ) b + --- diff --git a/tests_metricflow/integration/test_cases/itest_metrics.yaml b/tests_metricflow/integration/test_cases/itest_metrics.yaml index 537f54dbfc..8c7aaca084 100644 --- a/tests_metricflow/integration/test_cases/itest_metrics.yaml +++ b/tests_metricflow/integration/test_cases/itest_metrics.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: simple_expr_metric description: Test for expr metric @@ -584,8 +583,7 @@ integration_test: description: Tests querying two metrics with a dimension having a NULL values model: SIMPLE_MODEL metrics: ["bookings", "views"] - group_bys: - ["metric_time", "listing__is_lux_latest", "listing__country_latest"] + group_bys: ["metric_time", "listing__is_lux_latest", "listing__country_latest"] check_query: | SELECT MAX(bk.bookings) AS bookings @@ -1110,12 +1108,8 @@ integration_test: description: Test query using multiple date_parts model: SIMPLE_MODEL metrics: ["bookings"] - group_by_objs: [ - {"name": "metric_time", "date_part": "quarter"}, - {"name": "metric_time", "date_part": "dow"}, - {"name": "metric_time", "date_part": "doy"}, - {"name": "metric_time", "date_part": "day"}, - ] + group_by_objs: [{"name": "metric_time", "date_part": "quarter"}, {"name": "metric_time", "date_part": "dow"}, {"name": "metric_time", "date_part": "doy"}, + {"name": "metric_time", "date_part": "day"}] check_query: | SELECT SUM(1) AS bookings @@ -1751,7 +1745,8 @@ integration_test: --- integration_test: name: nested_derived_metric_offset_with_joined_where_constraint_not_selected - description: Tests a nested derived metric where the outer metric has an offset and where constraint that requires an additional join, and is not used in the select statement. + description: Tests a nested derived metric where the outer metric has an offset and where constraint that requires an additional join, and is not used + in the select statement. model: SIMPLE_MODEL metrics: ["bookings_offset_twice"] group_by_objs: [{"name": "metric_time", "grain": "day"}] @@ -2163,11 +2158,12 @@ integration_test: --- integration_test: name: simple_join_to_time_spine_with_filter - description: Test a simple metric that joins to time spine, but doesn't fill nulls, filtered by a dimension that's not in the group by. Should apply constraint only once. + description: Test a simple metric that joins to time spine, but doesn't fill nulls, filtered by a dimension that's not in the group by. Should apply constraint + only once. model: SIMPLE_MODEL metrics: ["bookings_join_to_time_spine"] group_by_objs: [{"name": "metric_time"}] - where_filter: "{{ render_dimension_template('booking__is_instant') }}" + where_filter: "{{ render_dimension_template('booking__is_instant') }}" check_query: | SELECT b.ds AS metric_time__day @@ -2184,11 +2180,12 @@ integration_test: --- integration_test: name: simple_join_to_time_spine_with_queried_filter - description: Test a simple metric that joins to time spine, but doesn't fill nulls, filtered by a dimension that is in the group by. Should apply constraint twice. + description: Test a simple metric that joins to time spine, but doesn't fill nulls, filtered by a dimension that is in the group by. Should apply constraint + twice. model: SIMPLE_MODEL metrics: ["bookings_join_to_time_spine"] group_by_objs: [{"name": "metric_time"}, {"name": "booking__is_instant"}] - where_filter: "{{ render_dimension_template('booking__is_instant') }}" + where_filter: "{{ render_dimension_template('booking__is_instant') }}" check_query: | SELECT b.ds AS metric_time__day diff --git a/tests_metricflow/integration/test_cases/itest_multi_hop_join.yaml b/tests_metricflow/integration/test_cases/itest_multi_hop_join.yaml index e226f43bb9..76852bb6f8 100644 --- a/tests_metricflow/integration/test_cases/itest_multi_hop_join.yaml +++ b/tests_metricflow/integration/test_cases/itest_multi_hop_join.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: multihop_join description: Tests a query with a basic multi-hop join @@ -22,11 +21,7 @@ integration_test: description: Tests a query requesting mulitple multi-hop join dims that dont come from the same semantic model model: UNPARTITIONED_MULTI_HOP_JOIN_MODEL metrics: ["txn_count"] - group_bys: - [ - "account_id__customer_id__customer_name", - "account_id__customer_id__country", - ] + group_bys: ["account_id__customer_id__customer_name", "account_id__customer_id__country"] check_query: | SELECT dim_src0.customer_name as account_id__customer_id__customer_name @@ -56,11 +51,7 @@ integration_test: description: Tests a query requesting mulitple multi-hop join dims from the same source model: UNPARTITIONED_MULTI_HOP_JOIN_MODEL metrics: ["txn_count"] - group_bys: - [ - "account_id__customer_id__customer_name", - "account_id__customer_id__customer_atomic_weight", - ] + group_bys: ["account_id__customer_id__customer_name", "account_id__customer_id__customer_atomic_weight"] check_query: | SELECT ct.customer_name as account_id__customer_id__customer_name @@ -80,12 +71,7 @@ integration_test: description: Tests a query with multihop and single hop join dimensions model: UNPARTITIONED_MULTI_HOP_JOIN_MODEL metrics: ["txn_count"] - group_bys: - [ - "account_id__customer_id__customer_name", - "account_id__customer_id__country", - "account_id__extra_dim", - ] + group_bys: ["account_id__customer_id__customer_name", "account_id__customer_id__country", "account_id__extra_dim"] check_query: | SELECT dim_src0.customer_name as account_id__customer_id__customer_name diff --git a/tests_metricflow/integration/test_cases/itest_order_limit.yaml b/tests_metricflow/integration/test_cases/itest_order_limit.yaml index 0cc563056a..3c43f7720b 100644 --- a/tests_metricflow/integration/test_cases/itest_order_limit.yaml +++ b/tests_metricflow/integration/test_cases/itest_order_limit.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: order_desc description: Tests descending order. diff --git a/tests_metricflow/integration/test_cases/itest_partitions.yaml b/tests_metricflow/integration/test_cases/itest_partitions.yaml index e7cddad708..3faaaf7bab 100644 --- a/tests_metricflow/integration/test_cases/itest_partitions.yaml +++ b/tests_metricflow/integration/test_cases/itest_partitions.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: partition_rollup description: Tests grouping by a partition column. diff --git a/tests_metricflow/integration/test_cases/itest_scd.yaml b/tests_metricflow/integration/test_cases/itest_scd.yaml index b44b444060..fb7ab3ce60 100644 --- a/tests_metricflow/integration/test_cases/itest_scd.yaml +++ b/tests_metricflow/integration/test_cases/itest_scd.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: simple_scd_grouped_metric description: Tests selecting a simple metric grouped by an SCD dimension @@ -72,8 +71,7 @@ integration_test: correct output. model: SCD_MODEL metrics: ["bookings"] - group_bys: - ["metric_time", "listing__is_lux", "listing__user__home_state_latest"] + group_bys: ["metric_time", "listing__is_lux", "listing__user__home_state_latest"] check_query: | SELECT a.ds AS metric_time__day diff --git a/tests_metricflow/integration/test_cases/itest_semi_additive_measure.yaml b/tests_metricflow/integration/test_cases/itest_semi_additive_measure.yaml index 58aec8cc0e..9b70e1a345 100644 --- a/tests_metricflow/integration/test_cases/itest_semi_additive_measure.yaml +++ b/tests_metricflow/integration/test_cases/itest_semi_additive_measure.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: semi_additive_measure_query_with_identifier_grouping description: Tests selecting a measure with semi additive properties with a window_grouping diff --git a/tests_metricflow/integration/test_cases/itest_simple.yaml b/tests_metricflow/integration/test_cases/itest_simple.yaml index e4dc5cb5d6..1dd52df82a 100644 --- a/tests_metricflow/integration/test_cases/itest_simple.yaml +++ b/tests_metricflow/integration/test_cases/itest_simple.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: simple_query description: Tests selecting a metric and an associated local dimension. diff --git a/tests_metricflow/integration/test_cases/itest_simple_non_sm.yaml b/tests_metricflow/integration/test_cases/itest_simple_non_sm.yaml index 8096844835..0f88531948 100644 --- a/tests_metricflow/integration/test_cases/itest_simple_non_sm.yaml +++ b/tests_metricflow/integration/test_cases/itest_simple_non_sm.yaml @@ -1,4 +1,3 @@ ---- integration_test: name: simple_query_non_ds description: Tests selecting a metric and dimensions in ds-less model