GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Bumping fastapi + starlette by bushwhackr · Pull Request #3938 · feast-dev/feast

Conversation

@bushwhackr

@bushwhackr bushwhackr commented Feb 7, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Bumping vuln fastapi version. https://nvd.nist.gov/vuln/detail/CVE-2024-24762

Changes

  • cicd: mypy now only checks sdk/python/feast directory
  • cicd: sdk/python/requirements/*.txt are all bumped wrt. the version constraint in setup.py
  • lint: many base class with abstract methods have be altered to throw NotImplementedError instead due to missing implementation in some subclass.

Which issue(s) this PR fixes:

Fixes #3931 #3930

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fbad, paolo-cristofanelli, sudohainguyen, and jnavarro86 reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
@dependabot
chore: Bump fastapi from 0.99.1 to 0.109.1 in /sdk/python/requirements
450bbac
Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.99.1 to 0.109.1.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](fastapi/fastapi@0.99.1...0.109.1)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@bushwhackr bushwhackr changed the title chore: bumping fastapi + starlette chore: Bumping fastapi + starlette Feb 7, 2024
@bushwhackr
bushwhackr force-pushed the bushwhackr/fastapi-starlette branch from 012dbd2 to bcebc63 Compare February 7, 2024 02:55
@bushwhackr
removing version constraint for fastapi, bumping starlette dependency
b9b8b26
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
bushwhackr force-pushed the bushwhackr/fastapi-starlette branch from bcebc63 to b9b8b26 Compare February 7, 2024 02:56
@sudohainguyen
sudohainguyen self-requested a review February 7, 2024 03:03
@sudohainguyen sudohainguyen mentioned this pull request Feb 7, 2024
chore: Bump fastapi from 0.99.1 to 0.109.1 in /sdk/python/requirements #3931
Closed
@sudohainguyen sudohainguyen added approved ok-to-test labels Feb 7, 2024
@bushwhackr
rerun
698ce46
Signed-off-by: Chester Ong <[email protected]>
@sudohainguyen

sudohainguyen commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

Linting failed, could you check @bushwhackr ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen sudohainguyen mentioned this pull request Feb 8, 2024
feat: Upgrade the pydantic from v1 to V2 #3942
Closed
@bushwhackr

bushwhackr commented Feb 8, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

image

The issue is mypy version I think

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

Considering upgrading mypy too? 👀

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bushwhackr

bushwhackr commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

I'm looking to pin the mypy version to 1.4.1 but like the #3942 there are quite a number of linting failures. Let me see if I can do one with minimum changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bushwhackr and others added 3 commits February 8, 2024 14:03
@bushwhackr
bumping mypy>=1.4.1
2bd6a9e
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
ran no_implicit_optional sdk/python
bc7ce0d
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
fixed missing body errors for abstract methods by raising NotImplemen…
efab860
…tedError

Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
bushwhackr requested review from a team, kevjumba, niklasvm, sfc-gh-madkins and younggyu-oh as code owners February 8, 2024 06:28
@bushwhackr
added more type hints
d9ddf13
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
bushwhackr force-pushed the bushwhackr/fastapi-starlette branch from 0ef5334 to d9ddf13 Compare February 8, 2024 07:34
@bushwhackr

bushwhackr commented Feb 8, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I'm of the opinion to skip tests mypy type errors till a later PR. Seems like alot of classes in sdk/python/tests/integration/feature_repos/universal/**/* have classes that do not confirm to the BaseClass abstract method definition.

For example:
baseclass:

feast/sdk/python/tests/integration/feature_repos/universal/data_source_creator.py

Lines 16 to 25 in 49d2988

@abstractmethod
def create_data_source(
self,
df: pd.DataFrame,
destination_name: str,
event_timestamp_column="ts",
created_timestamp_column="created_ts",
field_mapping: Dict[str, str] = None,
timestamp_field: Optional[str] = None,
) -> DataSource:

subclass:

feast/sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py

Lines 63 to 71 in 49d2988

def create_data_source(
self,
df: pd.DataFrame,
destination_name: str,
timestamp_field="ts",
created_timestamp_column="created_ts",
field_mapping: Dict[str, str] = None,
**kwargs,
) -> DataSource:

sudohainguyen reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bushwhackr added 4 commits February 8, 2024 22:55
@bushwhackr
bump all python requirements.lock file
23dbcf7
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
ignoring tests sdk/python/tests/ type linting
e0e033b
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
lint fixes
fc4a963
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
isort fixes
7f1cb7a
Signed-off-by: Chester Ong <[email protected]>
bushwhackr added 3 commits February 8, 2024 23:36
@bushwhackr
black and flake8 fixes
3ceaa06
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
Merge branch 'master' into bushwhackr/fastapi-starlette
4587099
@bushwhackr
fix circular import
73193af
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr

bushwhackr commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

@sudohainguyen could you rerun the tests. Linting should pass now

   ~/repo/feast    bushwhackr/fastapi-starlette ?1 ❯ make lint-python                                                                                                                                                                                                                                                                      30s   feast   00:14:46
cd /home/chester/repo/feast/sdk/python; python -m mypy --exclude=/tests/ --follow-imports=skip feast
feast/on_demand_feature_view.py:345: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/on_demand_feature_view.py:368: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/on_demand_feature_view.py:403: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/feature_store.py:1009: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/repo_operations.py:249: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/repo_operations.py:263: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/utils/snowflake/snowflake_utils.py:78: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/materialization/contrib/bytewax/bytewax_materialization_dataflow.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Success: no issues found in 293 source files
cd /home/chester/repo/feast/sdk/python; python -m isort feast/ tests/ --check-only
Skipped 1 files
cd /home/chester/repo/feast/sdk/python; python -m flake8 feast/ tests/
cd /home/chester/repo/feast/sdk/python; python -m black --check feast tests
All done! ✨ 🍰 ✨
365 files would be left unchanged.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

great! re-running

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

oh no 😢 @bushwhackr fail again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bushwhackr
lint fix
94ced34
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr
bushwhackr force-pushed the bushwhackr/fastapi-starlette branch from e1ac385 to 94ced34 Compare February 8, 2024 16:33
@bushwhackr
use typing types to support python3.8
59ba407
Signed-off-by: Chester Ong <[email protected]>
@bushwhackr

bushwhackr commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

hopefully it works now, just tested against python 3.8.

image

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 8, 2024

Copy link
Copy Markdown
Collaborator

great, now unit tests 😓

bushwhackr reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bushwhackr
tests fix: make foo_provider concrete again | MockRetrievalJob to be …
72ce6c4
…concrete

Signed-off-by: Chester Ong <[email protected]>
@bushwhackr

bushwhackr commented Feb 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@sudohainguyen my bad, please try again. Hopefully I can get this in before lunar new year

sudohainguyen reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator

Perfect! All checks passed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sudohainguyen
sudohainguyen approved these changes Feb 9, 2024
View reviewed changes

@sudohainguyen sudohainguyen left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

great work! all problem solved
lgtm
is there any issue in terms of performance we should know? @bushwhackr

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bushwhackr

bushwhackr commented Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

great work! all problem solved lgtm is there any issue in terms of performance we should know? @bushwhackr

None at all, all changes are to fix linting issues.

sudohainguyen reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bushwhackr
bushwhackr commented Feb 9, 2024
View reviewed changes
Comment thread Makefile

lint-python:
cd ${ROOT_DIR}/sdk/python; python -m mypy
cd ${ROOT_DIR}/sdk/python; python -m mypy --exclude=/tests/ --follow-imports=skip feast

@bushwhackr bushwhackr Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would feel this is the biggest change, is that I only limit the linting checks to sdk/python/feast directory

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sudohainguyen sudohainguyen Feb 9, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

what if we still check tests? a lot of changes needed right?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bushwhackr reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bushwhackr

bushwhackr commented Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

to revert to the old mypy settings:

feast/on_demand_feature_view.py:345: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/on_demand_feature_view.py:368: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/on_demand_feature_view.py:403: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/offline_stores/snowflake_source.py:222: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
feast/infra/offline_stores/snowflake_source.py:253: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
feast/feature_store.py:1009: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/repo_operations.py:249: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/repo_operations.py:263: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/utils/snowflake/snowflake_utils.py:78: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/offline_stores/snowflake.py:189: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
feast/infra/offline_stores/snowflake.py:240: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
feast/infra/offline_stores/snowflake.py:274: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
feast/infra/offline_stores/snowflake.py:395: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
tests/utils/feature_records.py:335: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/unit/test_registry_server.py:22: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/unit/test_registry_server.py:33: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/unit/test_registry_server.py:51: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/materialization/contrib/bytewax/bytewax_materialization_dataflow.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/feature_repos/universal/online_store/redis.py:16: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/mysql.py:21: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/hbase.py:16: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/hazelcast.py:32: error: Return type "Dict[str, Any]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/dynamodb.py:18: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/datastore.py:26: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/cassandra.py:35: error: Return type "Dict[str, object]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/online_store/bigtable.py:31: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/feature_repos/universal/data_sources/snowflake.py:54: error: Argument 6 of "create_data_source" is incompatible with supertype "DataSourceCreator"; supertype defines the argument type as "Optional[str]"  [override]
tests/integration/feature_repos/universal/data_sources/snowflake.py:54: note: This violates the Liskov substitution principle
tests/integration/feature_repos/universal/data_sources/snowflake.py:54: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
tests/integration/feature_repos/universal/data_sources/snowflake.py:59: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOfflineStoreConfig"; expected "str"  [arg-type]
tests/integration/feature_repos/universal/data_sources/redshift.py:54: error: Argument 6 of "create_data_source" is incompatible with supertype "DataSourceCreator"; supertype defines the argument type as "Optional[str]"  [override]
tests/integration/feature_repos/universal/data_sources/redshift.py:54: note: This violates the Liskov substitution principle
tests/integration/feature_repos/universal/data_sources/redshift.py:54: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
tests/integration/feature_repos/universal/data_sources/file.py:38: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
tests/integration/feature_repos/universal/data_sources/file.py:38: note:      Superclass:
tests/integration/feature_repos/universal/data_sources/file.py:38: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/file.py:38: note:      Subclass:
tests/integration/feature_repos/universal/data_sources/file.py:38: note:          def create_data_source(self, df: Any, destination_name: str, timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/file.py:93: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
tests/integration/feature_repos/universal/data_sources/file.py:93: note:      Superclass:
tests/integration/feature_repos/universal/data_sources/file.py:93: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/file.py:93: note:      Subclass:
tests/integration/feature_repos/universal/data_sources/file.py:93: note:          def create_data_source(self, df: Any, destination_name: str, timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/file.py:167: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
tests/integration/feature_repos/universal/data_sources/file.py:167: note:      Superclass:
tests/integration/feature_repos/universal/data_sources/file.py:167: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/file.py:167: note:      Subclass:
tests/integration/feature_repos/universal/data_sources/file.py:167: note:          def create_data_source(self, df: Any, destination_name: Optional[str] = ..., suffix: Optional[str] = ..., timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/bigquery.py:63: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
tests/integration/feature_repos/universal/data_sources/bigquery.py:63: note:      Superclass:
tests/integration/feature_repos/universal/data_sources/bigquery.py:63: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
tests/integration/feature_repos/universal/data_sources/bigquery.py:63: note:      Subclass:
tests/integration/feature_repos/universal/data_sources/bigquery.py:63: note:          def create_data_source(self, df: Any, destination_name: str, timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., **kwargs: Any) -> DataSource
feast/infra/online_stores/snowflake.py:117: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOnlineStoreConfig"; expected "str"  [arg-type]
feast/infra/online_stores/snowflake.py:181: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOnlineStoreConfig"; expected "str"  [arg-type]
feast/infra/online_stores/snowflake.py:223: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOnlineStoreConfig"; expected "str"  [arg-type]
feast/infra/online_stores/snowflake.py:251: error: Argument 1 to "GetSnowflakeConnection" has incompatible type "SnowflakeOnlineStoreConfig"; expected "str"  [arg-type]
feast/infra/offline_stores/contrib/spark_offline_store/tests/data_source.py:67: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
feast/infra/offline_stores/contrib/spark_offline_store/tests/data_source.py:67: note:      Superclass:
feast/infra/offline_stores/contrib/spark_offline_store/tests/data_source.py:67: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
feast/infra/offline_stores/contrib/spark_offline_store/tests/data_source.py:67: note:      Subclass:
feast/infra/offline_stores/contrib/spark_offline_store/tests/data_source.py:67: note:          def create_data_source(self, df: Any, destination_name: str, timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., **kwargs: Any) -> DataSource
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:58: error: Return type "MsSqlServerOfflineStoreConfig" of "create_offline_store_config" incompatible with return type "FeastConfigBaseModel" in supertype "DataSourceCreator"  [override]
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:63: error: Signature of "create_data_source" incompatible with supertype "DataSourceCreator"  [override]
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:63: note:      Superclass:
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:63: note:          def create_data_source(self, df: Any, destination_name: str, event_timestamp_column: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., timestamp_field: Optional[str] = ...) -> DataSource
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:63: note:      Subclass:
feast/infra/offline_stores/contrib/mssql_offline_store/tests/data_source.py:63: note:          def create_data_source(self, df: Any, destination_name: str, timestamp_field: Any = ..., created_timestamp_column: Any = ..., field_mapping: Optional[Dict[str, str]] = ..., **kwargs: Any) -> DataSource
feast/infra/offline_stores/contrib/athena_offline_store/tests/data_source.py:54: error: Argument 6 of "create_data_source" is incompatible with supertype "DataSourceCreator"; supertype defines the argument type as "Optional[str]"  [override]
feast/infra/offline_stores/contrib/athena_offline_store/tests/data_source.py:54: note: This violates the Liskov substitution principle
feast/infra/offline_stores/contrib/athena_offline_store/tests/data_source.py:54: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
feast/infra/contrib/spark_kafka_processor.py:71: error: Return type "StreamingQuery" of "ingest_stream_feature_view" incompatible with return type "None" in supertype "StreamProcessor"  [override]
feast/infra/contrib/spark_kafka_processor.py:132: error: Return type "StreamingQuery" of "_write_stream_data" incompatible with return type "None" in supertype "StreamProcessor"  [override]
tests/integration/registration/test_universal_types.py:337: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/registration/test_universal_types.py:356: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/feature_repos/repo_configuration.py:103: error: Dict entry 0 has incompatible type "str": "Tuple[str, Type[FileDataSourceCreator]]"; expected "str": "DataSourceCreator"  [dict-item]
tests/integration/feature_repos/repo_configuration.py:104: error: Dict entry 1 has incompatible type "str": "Tuple[str, Type[BigQueryDataSourceCreator]]"; expected "str": "DataSourceCreator"  [dict-item]
tests/integration/feature_repos/repo_configuration.py:105: error: Dict entry 2 has incompatible type "str": "Tuple[str, Type[RedshiftDataSourceCreator]]"; expected "str": "DataSourceCreator"  [dict-item]
tests/integration/feature_repos/repo_configuration.py:106: error: Dict entry 3 has incompatible type "str": "Tuple[str, Type[SnowflakeDataSourceCreator]]"; expected "str": "DataSourceCreator"  [dict-item]
tests/integration/feature_repos/repo_configuration.py:172: error: Value expression in dictionary comprehension has incompatible type "Tuple[Union[str, Dict[Any, Any], None], Optional[Type[OnlineStoreCreator]]]"; expected type "Tuple[Union[str, Dict[str, str]], Optional[Type[OnlineStoreCreator]]]"  [misc]
tests/integration/feature_repos/repo_configuration.py:353: error: Argument "driver_odfv" to "UniversalFeatureViews" has incompatible type "Optional[OnDemandFeatureView]"; expected "OnDemandFeatureView"  [arg-type]
tests/integration/feature_repos/repo_configuration.py:354: error: Argument 1 to "conv_rate_plus_100_feature_view" has incompatible type "List[Any]"; expected "Dict[str, Union[RequestSource, FeatureView]]"  [arg-type]
tests/integration/feature_repos/repo_configuration.py:378: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/feature_repos/repo_configuration.py:415: error: Incompatible types in assignment (expression has type "FeastConfigBaseModel", variable has type "Union[str, Dict[Any, Any], None]")  [assignment]
tests/integration/feature_repos/repo_configuration.py:418: error: Incompatible types in assignment (expression has type "Union[str, Dict[Any, Any], None]", variable has type "FeastConfigBaseModel")  [assignment]
tests/integration/feature_repos/repo_configuration.py:425: error: Missing named argument "feature_logging" for "AwsLambdaFeatureServerConfig"  [call-arg]
tests/integration/feature_repos/repo_configuration.py:434: error: Incompatible types in assignment (expression has type "LocalFeatureServerConfig", variable has type "AwsLambdaFeatureServerConfig")  [assignment]
tests/integration/feature_repos/repo_configuration.py:449: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/integration/feature_repos/repo_configuration.py:449: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/conftest.py:222: error: Incompatible types in assignment (expression has type "List[Tuple[str, Type[DataSourceCreator]]]", variable has type "Optional[List[Optional[DataSourceCreator]]]")  [assignment]
tests/conftest.py:225: error: List item 0 has incompatible type "Tuple[str, Type[FileDataSourceCreator]]"; expected "Optional[DataSourceCreator]"  [list-item]
tests/conftest.py:237: error: Incompatible types in assignment (expression has type "dict_values[str, Tuple[Union[str, Dict[str, str]], Optional[Type[OnlineStoreCreator]]]]", variable has type "Optional[List[Optional[Tuple[Union[str, Dict[str, str]], Optional[Type[OnlineStoreCreator]]]]]]")  [assignment]
tests/conftest.py:262: error: "DataSourceCreator" object is not iterable  [misc]
tests/conftest.py:262: error: "None" object is not iterable  [misc]
tests/conftest.py:263: error: "None" object is not iterable  [misc]
tests/conftest.py:292: error: List item 0 has incompatible type "Tuple[str, Type[FileDataSourceCreator]]"; expected "Optional[DataSourceCreator]"  [list-item]
tests/unit/online_store/test_online_retrieval.py:139: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/unit/online_store/test_online_retrieval.py:139: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/unit/online_store/test_online_retrieval.py:202: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/unit/online_store/test_online_retrieval.py:202: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/unit/infra/test_local_registry.py:41: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/unit/infra/test_local_registry.py:41: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/unit/cli/test_cli_chdir.py:21: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:24: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:28: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:37: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:47: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:52: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/unit/cli/test_cli_chdir.py:55: error: List item 1 has incompatible type "Path"; expected "str"  [list-item]
tests/integration/registration/test_registry.py:45: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/integration/registration/test_registry.py:45: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/integration/registration/test_registry.py:56: error: Missing named argument "registry_store_type" for "RegistryConfig"  [call-arg]
tests/integration/registration/test_registry.py:56: error: Missing named argument "s3_additional_kwargs" for "RegistryConfig"  [call-arg]
tests/integration/offline_store/test_universal_historical_retrieval.py:170: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/offline_store/test_s3_custom_endpoint.py:43: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/integration/offline_store/test_offline_write.py:134: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
feast/infra/offline_stores/contrib/trino_offline_store/tests/data_source.py:87: error: Argument 6 of "create_data_source" is incompatible with supertype "DataSourceCreator"; supertype defines the argument type as "Optional[str]"  [override]
feast/infra/offline_stores/contrib/trino_offline_store/tests/data_source.py:87: note: This violates the Liskov substitution principle
feast/infra/offline_stores/contrib/trino_offline_store/tests/data_source.py:87: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
feast/infra/offline_stores/contrib/trino_offline_store/tests/data_source.py:125: error: Missing named argument "user" for "TrinoOfflineStoreConfig"  [call-arg]
feast/infra/offline_stores/contrib/trino_offline_store/tests/data_source.py:125: error: Missing named argument "auth" for "TrinoOfflineStoreConfig"  [call-arg]
feast/infra/offline_stores/contrib/postgres_offline_store/tests/data_source.py:88: error: Argument 6 of "create_data_source" is incompatible with supertype "DataSourceCreator"; supertype defines the argument type as "Optional[str]"  [override]
feast/infra/offline_stores/contrib/postgres_offline_store/tests/data_source.py:88: note: This violates the Liskov substitution principle
feast/infra/offline_stores/contrib/postgres_offline_store/tests/data_source.py:88: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
feast/infra/offline_stores/contrib/postgres_offline_store/tests/data_source.py:109: error: Return type "Dict[str, str]" of "create_online_store" incompatible with return type "FeastConfigBaseModel" in supertype "OnlineStoreCreator"  [override]
tests/integration/e2e/test_python_feature_server.py:131: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Found 73 errors in 27 files (checked 427 source files)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator

alright, let's get rid of it in another PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shuchu
shuchu reviewed Feb 9, 2024
View reviewed changes
Comment thread sdk/python/feast/infra/registry/snowflake.py
cursor = execute_snowflake_statement(conn, query)

if cursor.rowcount < 1 and not_found_exception:
if cursor.rowcount < 1 and not_found_exception: # type: ignore

@shuchu shuchu Feb 9, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I tried this and can pass the mypy check:
if cursor.rowcount and (cursor.rowcount < 1) and not_found_exception:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bushwhackr bushwhackr Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

You're right, this is due to another change I did to the mypy config: --follow-imports=skip.

run the below command to see the error:
python -m mypy --exclude=/tests/ sdk/python/feast/infra/registry/snowflake.py you will see an error.

`sdk/python/feast/infra/registry/snowflake.py:421: error: Unsupported operand types for > ("int" and "None")  [operator]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bushwhackr bushwhackr Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

essentially cursor.rowcount could return none from snowflake's signature

    @property
    def rowcount(self) -> int | None:
        return self._total_rowcount if self._total_rowcount >= 0 else None

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shuchu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bushwhackr

bushwhackr commented Feb 10, 2024

Copy link
Copy Markdown
Contributor Author

any blockers?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen

sudohainguyen commented Feb 10, 2024

Copy link
Copy Markdown
Collaborator

Need your merge actions here 🙏 @franciscojavierarceo

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franciscojavierarceo
franciscojavierarceo merged commit 4e450ad into feast-dev:master Feb 10, 2024
@shuchu

shuchu commented Feb 11, 2024

Copy link
Copy Markdown
Collaborator

BaseClass

I will fix (have fixed) this in my PR. #3942

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sudohainguyen sudohainguyen added the dependencies Pull requests that update a dependency file label Feb 11, 2024
@bushwhackr
bushwhackr deleted the bushwhackr/fastapi-starlette branch February 11, 2024 16:46
@bushwhackr bushwhackr mentioned this pull request Feb 11, 2024
chore: Refactoring to fix mypy linting #3947
Closed
tqtensor pushed a commit to tqtensor/feast that referenced this pull request Mar 11, 2024
@bushwhackr @tqtensor
chore: Bumping fastapi + starlette (feast-dev#3938)
1ee8cf7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shuchu shuchu shuchu left review comments
@sudohainguyen sudohainguyen sudohainguyen approved these changes
@niklasvm niklasvm Awaiting requested review from niklasvm
@kevjumba kevjumba Awaiting requested review from kevjumba
@younggyu-oh younggyu-oh Awaiting requested review from younggyu-oh
@sfc-gh-madkins sfc-gh-madkins Awaiting requested review from sfc-gh-madkins

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

approved dependencies Pull requests that update a dependency file ok-to-test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@bushwhackr @sudohainguyen @shuchu @franciscojavierarceo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.