Lukas1v opened a new pull request, #38316:
URL: https://github.com/apache/airflow/pull/38316
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
When you launch the devcontainer, both in a local environment and in
Codespaces, and attempt to execute any database-related unit tests:
`root@6d3f729fbdb1:/opt/airflow# pytest --log-cli-level=DEBUG
tests/core/test_core.py::TestCore`
the following error appears because there is no local sqlite db created:
```
========================================================================================================
test session starts
=========================================================================================================
platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.4.0 --
/usr/local/bin/python
cachedir: .pytest_cache
rootdir: /opt/airflow
configfile: pyproject.toml
plugins: requests-mock-1.11.0, instafail-0.5.0, time-machine-2.14.0,
mock-3.12.0, xdist-3.5.0, rerunfailures-13.0, asyncio-0.23.5.post1,
timeouts-1.2.1, anyio-4.3.0, cov-4.1.0, icdiff-0.9
asyncio: mode=strict
setup timeout: 0.0s, execution timeout: 0.0s, teardown timeout: 0.0s
--------------------------------------------------------------------------------------------------------
live log collection
---------------------------------------------------------------------------------------------------------
INFO airflow.configuration:configuration.py:1780 Unit test configuration
loaded from 'config_unit_tests.cfg'
INFO airflow.settings:settings.py:59 Configured default timezone UTC
DEBUG airflow.settings:settings.py:476 No airflow_local_settings to
import.
Traceback (most recent call last):
File "/opt/airflow/airflow/settings.py", line 473, in import_local_settings
import airflow_local_settings
ModuleNotFoundError: No module named 'airflow_local_settings'
DEBUG airflow.logging_config:logging_config.py:54 Unable to load custom
logging, using default config instead
DEBUG SQL_ALCHEMY_CONN
=======================================================================================================
no tests ran in 1.53s
========================================================================================================
ERROR: while parsing the following warning configuration:
error::airflow.utils.context.AirflowContextDeprecationWarning
This error occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/_pytest/config/__init__.py",
line 1761, in parse_warning_filter
category: Type[Warning] = _resolve_warning_category(category_)
File "/usr/local/lib/python3.8/site-packages/_pytest/config/__init__.py",
line 1799, in _resolve_warning_category
m = __import__(module, None, None, [klass])
File "/opt/airflow/airflow/__init__.py", line 68, in <module>
settings.initialize()
File "/opt/airflow/airflow/settings.py", line 532, in initialize
configure_orm()
File "/opt/airflow/airflow/settings.py", line 256, in configure_orm
engine = create_engine(SQL_ALCHEMY_CONN, connect_args=connect_args,
**engine_args, future=True)
File "<string>", line 2, in create_engine
File
"/usr/local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line
375, in warned
return fn(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/create.py",
line 514, in create_engine
u = _url.make_url(url)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py",
line 738, in make_url
return _parse_url(name_or_url)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py",
line 799, in _parse_url
raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string ''
```
The file `scripts/ci/docker-compose/backend-sqlite.yml` contains the
following line:
` - AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=${SQLITE_URL}`
Which is not filled in at devcontainer runtime creation. To solve this I
added a new file `scripts/ci/docker-compose/devcontainer-sqlite.yml` with the
path hard coded. The structure of a devcontainer with SQLite is now also
consistent with devcontainer-postgres.yml and devcontainer-mysql.yml.
I also took the liberty to update the python version in the devcontainer
from 3.8 to 3.10
**^ Add meaningful description above**
Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information.
In case of fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party
License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a
newsfragment file, named `{pr_number}.significant.rst` or
`{issue_number}.significant.rst`, in
[newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]