Skip to content

Resolve sqlalchemy import failures in mindeps testing#9809

Merged
mrocklin merged 4 commits intodask:mainfrom
charlesbluca:resolve-sqlalchemy-warnings
Jan 9, 2023
Merged

Resolve sqlalchemy import failures in mindeps testing#9809
mrocklin merged 4 commits intodask:mainfrom
charlesbluca:resolve-sqlalchemy-warnings

Conversation

@charlesbluca
Copy link
Copy Markdown
Member

@charlesbluca charlesbluca commented Jan 5, 2023

#9801 added a warning filter for sqlalchemy.exc.RemovedIn20Warning that referred to the module directly, raising failures in our mindeps testing since sqlalchemy is not installed in that environment.

This PR modifies the warning filter to match for the warning using regex, which doesn't require sqlalchemy to be installed and resolves the mindeps failures.

cc @graingert

  • Closes #xxxx
  • Tests added / passed
  • Passes pre-commit run --all-files

@charlesbluca charlesbluca marked this pull request as ready for review January 5, 2023 17:15
@graingert
Copy link
Copy Markdown
Member

I wonder if it would be better to use an alias like

try:
    from sqlalchemy.ext import RemovedIn20Warning
except ModuleNotFoundError:
    class RemovedIn20Warning(Warning):
        pass

and setting the warning to ignore:.*:dask.tests.warn_aliases.RemovedIn20Warning?

@mrocklin
Copy link
Copy Markdown
Member

mrocklin commented Jan 9, 2023

This is looking good so far. Thank you @charlesbluca and @graingert . The current failure is listed at #9793 (which we should also resolve ASAP)

Merging.

@mrocklin mrocklin merged commit 43e8d7e into dask:main Jan 9, 2023
Copy link
Copy Markdown
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

We're seeing

09:15:35 ERROR: while parsing the following warning configuration:

09:15:35 

09:15:35   ignore:.*:dask.tests.warning_aliases.RemovedIn20Warning

09:15:35 

09:15:35 This error occurred:

09:15:35 

09:15:35 Traceback (most recent call last):

09:15:35   File "/opt/conda/envs/dask/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1690, in parse_warning_filter

09:15:35     category: Type[Warning] = _resolve_warning_category(category_)

09:15:35   File "/opt/conda/envs/dask/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1728, in _resolve_warning_category

09:15:35     m = __import__(module, None, None, [klass])

09:15:35 ModuleNotFoundError: No module named 'dask.tests.warning_aliases'

failing in the gpuCI here. @charlesbluca @graingert any thoughts on why that may be?

This was referenced Jan 9, 2023
@charlesbluca
Copy link
Copy Markdown
Member Author

Think the issue here is that the gpuCI build is running python setup.py install versus a pip install (at least that seemed to reproduce things locally); can go ahead and open up a PR making the needed modification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants