Skip to content

Commit

Permalink
Edickinson window bug fixes (#31)
Browse files Browse the repository at this point in the history
* - fix bigquery quoting for nested struct references

* version bump

* - improvements to date function handling for BQ
- modifier API interface

* - Fix sqlalchemy deprecation warnings

* - Promote description up into metadata object
- Support passthrough of metadata args beyond parsing phase

* - Promote description up into metadata object
- Support passthrough of metadata args beyond parsing phase

* - Create scalar function concept and improve handling of functions as grain outputs

* - Numerous fixes to query path generation

* - mypy fixes

* - mypy fixes
  • Loading branch information
greenmtnboy committed Mar 21, 2023
1 parent 6534374 commit fe37a0f
Show file tree
Hide file tree
Showing 24 changed files with 530 additions and 250 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
pip install codecov
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Lint with mypy
run: |
# stop the build if there are Python syntax errors or undefined names
mypy preql
- name: Lint with flake8
run: |
pip install flake8
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion preql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from preql.core.models import Environment


__version__ = "0.0.1-rc.17"
__version__ = "0.0.1-rc.18"

__all__ = ["parse", "Executor", "Dialects", "Environment"]
9 changes: 8 additions & 1 deletion preql/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ class FunctionType(Enum):


class FunctionClass(Enum):
AGGREGATE_FUNCTIONS = [FunctionType.SUM, FunctionType.AVG, FunctionType.COUNT]
AGGREGATE_FUNCTIONS = [
FunctionType.MAX,
FunctionType.MIN,
FunctionType.SUM,
FunctionType.AVG,
FunctionType.COUNT,
FunctionType.COUNT_DISTINCT,
]


class Boolean(Enum):
Expand Down
7 changes: 7 additions & 0 deletions preql/core/env_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ def generate_graph(environment: Environment,) -> ReferenceGraph:
# for example, order ID on order product table
g.add_edge(concept, concept.with_default_grain())

# TODO: evaluate better way to handle scalar function associations
# for _, concept in environment.concepts.items():
# if isinstance(concept.lineage, Function) and concept.lineage.operator not in FunctionClass.AGGREGATE_FUNCTIONS.value:
# if not all([c in dataset.concepts for c in concept.sources]):
# continue
# g.add_edge(dataset, concept.with_grain(dataset.grain))

return g
2 changes: 1 addition & 1 deletion preql/core/graph_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def add_node(self, node_for_adding, **attr):
else:
node_name = node_for_adding

if node_name.startswith("c~") and not "concept" in attr.keys():
if node_name.startswith("c~") and "concept" not in attr.keys():
raise ValueError
super().add_node(node_name, **attr)

Expand Down
Loading

0 comments on commit fe37a0f

Please sign in to comment.