Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enable type checks (MyPy) in the CI #510

Merged
merged 10 commits into from
Sep 6, 2023
Merged

Enable type checks (MyPy) in the CI #510

merged 10 commits into from
Sep 6, 2023

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented Sep 5, 2023

We had to disable MyPy checks from the pre-commit hook because we were reaching a quota from the pre-commit service:

build of https://github.com/pre-commit/mirrors-mypy:types-PyYAML,types-attrs,attrs,types-requests,types-python-dateutil,[email protected] for python@python3 exceeds tier max size 250MiB: 262.2MiB

As observed in #482.

This PR re-enables MyPy checks but in the CI.

Bonus: Fix Openlineage import error handling

@tatiana tatiana requested a review from a team as a code owner September 5, 2023 09:35
@tatiana tatiana requested a review from a team September 5, 2023 09:35
@netlify
Copy link

netlify bot commented Sep 5, 2023

👷 Deploy Preview for amazing-pothos-a3bca0 processing.

Name Link
🔨 Latest commit 9776dae
🔍 Latest deploy log https://app.netlify.com/sites/amazing-pothos-a3bca0/deploys/64f8db59f18289000812bfe3

@tatiana tatiana temporarily deployed to internal September 5, 2023 09:35 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 5, 2023 10:24 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 5, 2023 10:44 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 5, 2023 11:00 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 5, 2023 11:18 — with GitHub Actions Inactive
pyproject.toml Outdated Show resolved Hide resolved
@tatiana tatiana temporarily deployed to internal September 5, 2023 11:33 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 5, 2023 11:56 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 6, 2023 11:18 — with GitHub Actions Inactive
@tatiana tatiana temporarily deployed to internal September 6, 2023 11:50 — with GitHub Actions Inactive
@tatiana tatiana added this to the 1.1.0 milestone Sep 6, 2023
@tatiana tatiana mentioned this pull request Sep 6, 2023
@tatiana tatiana temporarily deployed to internal September 6, 2023 15:38 — with GitHub Actions Inactive
(cherry picked from commit 06c483d8bff403a552518a9944572d26aa684039)
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage: 95.65% and project coverage change: +0.18% 🎉

Comparison is base (6c3d673) 91.30% compared to head (4003354) 91.49%.
Report is 1 commits behind head on main.

❗ Current head 4003354 differs from pull request most recent head 6040e8e. Consider uploading reports for the commit 6040e8e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
+ Coverage   91.30%   91.49%   +0.18%     
==========================================
  Files          49       49              
  Lines        1921     1928       +7     
==========================================
+ Hits         1754     1764      +10     
+ Misses        167      164       -3     
Files Changed Coverage Δ
cosmos/operators/docker.py 69.76% <80.00%> (ø)
cosmos/operators/kubernetes.py 70.00% <100.00%> (ø)
cosmos/operators/local.py 83.55% <100.00%> (+1.42%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

As observed in:
#482

The following exception was raised:
build of https://github.com/pre-commit/mirrors-mypy:types-PyYAML,types-attrs,attrs,types-requests,types-python-dateutil,[email protected] for python@python3 exceeds tier max size 250MiB: 262.2MiB

So we disabled MyPy checks as part of #485
  File "/home/runner/.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6/lib/python3.10/site-packages/openlineage/common/provider/dbt/processor.py", line 568, in extract_adapter_type
    raise NotImplementedError(
NotImplementedError: Only `bigquery`,`snowflake`,`redshift`,`spark`,`***` adapters are supported right now. Passed databricks
@tatiana tatiana temporarily deployed to internal September 6, 2023 16:11 — with GitHub Actions Inactive
cosmos/operators/local.py Outdated Show resolved Hide resolved
Copy link
Contributor

@harels harels left a comment

Choose a reason for hiding this comment

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

nice! one minor comment, but LGTM

@tatiana tatiana temporarily deployed to internal September 6, 2023 20:04 — with GitHub Actions Inactive
@tatiana tatiana merged commit 6c3c003 into main Sep 6, 2023
36 of 38 checks passed
@tatiana tatiana deleted the enable-mypy-in-ci branch September 6, 2023 20:05
harels pushed a commit that referenced this pull request Sep 6, 2023
Fix an issue introduced by #510, which only surfaced in the CI after the
PR was merged.
tatiana added a commit that referenced this pull request Sep 6, 2023
**Features**

* Support dbt global flags (via dbt_cmd_global_flags in operator_args)
by @tatiana in #469
* Support parsing DAGs when there are no connections by @jlaneve in #489

**Enhancements**

* Hide sensitive field when using BigQuery keyfile_dict profile mapping
by @jbandoro in #471
* Consistent Airflow Dataset URIs, inlets and outlets with `Openlineage
package <https://pypi.org/project/openlineage-integration-common/>`_ by
@tatiana in #485. `Read more
<https://astronomer.github.io/astronomer-cosmos/configuration/lineage.html>`_.
* Refactor ``LoadMethod.DBT_LS`` to run from a temporary directory with
symbolic links by @tatiana in #488
* Run ``dbt deps`` when using ``LoadMethod.DBT_LS`` by @DanMawdsleyBA in
#481
* Update Cosmos log color to purple by @harels in #494
* Change operators to log ``dbt`` commands output as opposed to
recording to XCom by @tatiana in #513

**Bug fixes**

* Fix bug on select node add exclude selector subset ids logic by
@jensenity in #463
* Refactor dbt ls to run from a temporary directory, to avoid Read-only
file system errors during DAG parsing, by @tatiana in #414
* Fix profile_config arg in DbtKubernetesBaseOperator by @david-mag in
#505
* Fix SnowflakePrivateKeyPemProfileMapping private_key reference by
@nacpacheco in #501
* Fix incorrect temporary directory creation in VirtualenvOperator init
by @tatiana in #500
* Fix log propagation issue by @tatiana in #498
* Fix PostgresUserPasswordProfileMapping to retrieve port from
connection by @jlneve in #511

**Others**

* Docs: Fix RenderConfig load argument by @jbandoro in #466
* Enable CI integration tests from external forks by @tatiana in #458
* Improve CI tests runtime by @tatiana in #457
* Change CI to run coverage after tests pass by @tatiana in #461
* Fix forks code revision in code coverage by @tatiana in #472
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #467
* Drop support to Python 3.7 in the CI test matrix by @harels in #490
* Add Airflow 2.7 to the CI test matrix by @tatiana in #487
* Add MyPy type checks to CI since we exceeded pre-commit disk quota
usage by @tatiana in #510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants