From cb414d5768972d1565a9ec7ccaff429b0a6a60d9 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Mon, 30 May 2022 16:12:45 +0200 Subject: [PATCH] Fix BigQuery LENGTH (#5216) * BigQuery LENGTH * cat coverage * Fix coverage source --- .coveragerc | 2 +- Makefile | 3 ++- ingestion/src/metadata/orm_profiler/orm/functions/length.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index a7d6729d2e2..0048c56f2dc 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,4 @@ [run] relative_files = True branch = True -source = ingestion/ +source = ingestion/src/ diff --git a/Makefile b/Makefile index 632655679bb..e058cc75064 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ coverage: ## Run all Python tests and generate the coverage report coverage erase $(MAKE) unit_ingestion $(MAKE) run_ometa_integration_tests - coverage xml -i -o ingestion/coverage.xml + coverage xml -o ingestion/coverage.xml + cat ingestion/coverage.xml .PHONY: sonar_ingestion sonar_ingestion: ## Run the Sonar analysis based on the tests results and push it to SonarCloud diff --git a/ingestion/src/metadata/orm_profiler/orm/functions/length.py b/ingestion/src/metadata/orm_profiler/orm/functions/length.py index 3a0744cbbdf..46d16f40ae4 100644 --- a/ingestion/src/metadata/orm_profiler/orm/functions/length.py +++ b/ingestion/src/metadata/orm_profiler/orm/functions/length.py @@ -42,6 +42,7 @@ def _(element, compiler, **kw): @compiles(LenFn, Dialects.Athena) @compiles(LenFn, Dialects.Trino) @compiles(LenFn, Dialects.Presto) +@compiles(LenFn, Dialects.BigQuery) def _(element, compiler, **kw): return "LENGTH(%s)" % compiler.process(element.clauses, **kw)