utkarshsaraf19 opened a new issue, #34314:
URL: https://github.com/apache/airflow/issues/34314
### Apache Airflow version
2.7.1
### What happened
Although table is present in public schema as can be seen in attached image,
client is giving error
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table:
dag
[SQL: SELECT dag.dag_id, dag.root_dag_id, dag.is_paused, dag.is_subdag,
dag.is_active, dag.last_parsed_time, dag.last_pickled, dag.last_expired,
dag.scheduler_lock, dag.pickle_id, dag.fileloc, dag.processor_subdir,
dag.owners, dag.description, dag.default_view, dag.schedule_interval,
dag.timetable_description, dag.max_active_tasks, dag.max_active_runs,
dag.has_task_concurrency_limits, dag.has_import_errors, dag.next_dagrun,
dag.next_dagrun_data_interval_start, dag.next_dagrun_data_interval_end,
dag.next_dagrun_create_after
FROM dag
WHERE dag.dag_id = ?]
List of dependencies installed:
aiohttp==3.8.5
aiosignal==1.3.1
alembic==1.12.0
annotated-types==0.5.0
anyio==3.7.1
apache-airflow==2.7.1
apache-airflow-providers-common-sql==1.7.2
apache-airflow-providers-ftp==3.5.2
apache-airflow-providers-http==4.5.2
apache-airflow-providers-imap==3.3.2
apache-airflow-providers-sqlite==3.4.3
apispec==6.3.0
argcomplete==3.1.1
asgiref==3.7.2
async-timeout==4.0.3
attrs==23.1.0
Babel==2.12.1
backoff==2.2.1
blinker==1.6.2
cachelib==0.9.0
cattrs==23.1.2
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.2.0
click==8.1.7
clickclick==20.10.2
colorama==0.4.6
colorlog==4.8.0
ConfigUpdater==3.1.1
connexion==2.14.2
cron-descriptor==1.4.0
croniter==1.4.1
cryptography==41.0.3
Deprecated==1.2.14
dill==0.3.7
dnspython==2.4.2
docutils==0.20.1
email-validator==1.3.1
exceptiongroup==1.1.3
fastapi==0.103.1
Flask==2.2.5
Flask-AppBuilder==4.3.6
Flask-Babel==2.0.0
Flask-Caching==2.0.2
Flask-JWT-Extended==4.5.2
Flask-Limiter==3.5.0
Flask-Login==0.6.2
Flask-Session==0.5.0
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.1.1
frozenlist==1.4.0
google-re2==1.1
googleapis-common-protos==1.60.0
graphviz==0.20.1
grpcio==1.58.0
gunicorn==21.2.0
h11==0.14.0
httpcore==0.18.0
httpx==0.25.0
idna==3.4
importlib-metadata==6.8.0
importlib-resources==6.0.1
inflection==0.5.1
itsdangerous==2.1.2
Jinja2==3.1.2
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
lazy-object-proxy==1.9.0
limits==3.6.0
linkify-it-py==2.0.2
lockfile==0.12.2
Mako==1.2.4
Markdown==3.4.4
markdown-it-py==3.0.0
MarkupSafe==2.1.3
marshmallow==3.20.1
marshmallow-oneofschema==3.0.1
marshmallow-sqlalchemy==0.26.1
mdit-py-plugins==0.4.0
mdurl==0.1.2
multidict==6.0.4
opentelemetry-api==1.20.0
opentelemetry-exporter-otlp==1.20.0
opentelemetry-exporter-otlp-proto-common==1.20.0
opentelemetry-exporter-otlp-proto-grpc==1.20.0
opentelemetry-exporter-otlp-proto-http==1.20.0
opentelemetry-proto==1.20.0
opentelemetry-sdk==1.20.0
opentelemetry-semantic-conventions==0.41b0
ordered-set==4.1.0
packaging==23.1
pathspec==0.11.2
pendulum==2.1.2
pkgutil_resolve_name==1.3.10
pluggy==1.3.0
prison==0.2.1
protobuf==4.24.3
psutil==5.9.5
pycparser==2.21
pydantic==2.3.0
pydantic_core==2.6.3
Pygments==2.16.1
PyJWT==2.8.0
python-daemon==3.0.1
python-dateutil==2.8.2
python-nvd3==0.15.0
python-slugify==8.0.1
pytz==2023.3.post1
pytzdata==2020.1
PyYAML==6.0.1
referencing==0.30.2
requests==2.31.0
requests-toolbelt==1.0.0
rfc3339-validator==0.1.4
rich==13.5.2
rich-argparse==1.3.0
rpds-py==0.10.2
setproctitle==1.3.2
six==1.16.0
sniffio==1.3.0
SQLAlchemy==1.4.49
SQLAlchemy-JSONField==1.0.1.post0
SQLAlchemy-Utils==0.41.1
sqlparse==0.4.4
starlette==0.27.0
tabulate==0.9.0
tenacity==8.2.3
termcolor==2.3.0
text-unidecode==1.3
typing_extensions==4.7.1
uc-micro-py==1.0.2
unicodecsv==0.14.1
urllib3==2.0.4
uvicorn==0.23.2
Werkzeug==2.2.3
wrapt==1.15.0
WTForms==3.0.1
yarl==1.9.2
zipp==3.16.2
Code:
```
from airflow.api.client.local_client import Client
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class ImageNameInput(BaseModel):
image_name: str
@app.post("/trigger-dag")
async def trigger_dag_with_image_name(input_data: ImageNameInput):
# Get the image name from the request
image_name = input_data.image_name
# Trigger the Airflow DAG with the image name as a parameter
client = Client(api_base_url="http://localhost:8080")
client.trigger_dag(dag_id="kubernetes_pod_dag", conf={"image_name":
image_name})
return {"message": "DAG triggered successfully"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="localhost", port=8000)
```
<img width="1336" alt="Screenshot 2023-09-12 at 10 08 07 PM"
src="https://github.com/apache/airflow/assets/10270194/ebbf29db-a0c6-4511-93e6-6994106e3fda">
### What you think should happen instead
It should query the table `dag` in public schema.
### How to reproduce
1. Run docker compose as suggested by website.
2. Run the python code to trigger explicit dag kept In local dags folder.
### Operating System
mac os ventura
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]