구글링해보면 Airflow가 전체적으로 2.X 지원을 준비하는 것 같긴 합니다만, docker-compose로 airflow 2.8.4 docker를 설치하면 SQLAlchemy가 1.4.X가 설치되는 것 같습니다. 저희가 만든 Dags는 내부에 SQLAlchemdy 2.X를 사용해서 DB 접근을 하는 코드가 있는데 Airflow에 SQLAlchemy 2.X를 설치해서 쓰는 방법이 있을까요? 예를 들면, dags를 실행하는 Airflow-worker에 SQLAlchemy 최신 버전을 pip install로 설치한다던지요.. 또는 기본 Base가 되는 이미지에 2.X로 업그레이드 시키거나, worker에 2.X를 설치할 때 Airflow의 기존 로직들은 이상이 없을지요? 아니면, 아래처럼 virtual env 방식으로 SQLAlchemy를 설치하는 식으로 사용해야 할까요? @task.virtualenv( task_id="virtualenv_python", requirements=["SQLAlchemy==2.0.0"], system_site_packages=False ) 일반적으로 사용하는 방법에 대해 궁금합니다. 감사합니다.
안녕하세요. 그대로 코드를 진행했는데요. 상호참조하는 것 관련해서 에러가 나는데 그냥 무시를 해도 될까요? => admin = Role(position='admin') 실행시 에러문구 workspace/inflearn_240120/venv/bin/ipython:1: SAWarning: relationship 'User.project' will copy column user.id to column user_project.user_id, which conflicts with rel ationship(s): 'Project.user' (copies user.id to user_project.user_id), 'User.projects' (copies user.id to user_project.user_id). If this is not the intention, consider if theserelationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign()annotation can be used to isolate the columns that should be written towards. To silence this war ning, add the parameter 'overlaps="projects,user"' to the 'User.project' relationship. (Background on this warning at: https://sqlalche.me/e/20/qzyx) (This warning ori ginatedfrom the configure_mappers() process, which was invoked automatically in response to a user-initiated operation.)
안녕하세요. 파이썬 class 부분이 약하다보니 헤매면서 개념을 잡아가며 진도를 빼고 있습니다. 한가지 좀 희안한 현상이 있는데요. 왜 이렇게 되는 지 모르겠습니다. 화면대로 따라가다가 잘 안되서 이런 저런 방법으로 개별 요소까지 넣었는데요. 강사님과 동일한 py 파일이구요. 그런데, User.query.all() 을 해보면 User 의 name 으로 출력이 안되늗데요. 왜 그런건가요? py 파일내 class User 이하 부분에 def repr (self): return '<User %r>' $ self.name 을 넣어줘야 할까요? 감사님 화면에는 해당 줄이 없어도 출력이 name 으로 나오던데요.
안녕하세요. 혹시 저처럼 안되시는 분 참고하시라고 올립니다. 강의시점과 현시점이 차이가 나서 그런지 강사님 화면대로 하는데 에러가 나서 구글링을 해보니, 추가로 해줘야 한다고 해서 하고 나시 성공했네요. [에러화면] [구글링 참고화면 ] https://stackoverflow.com/questions/73961938/flask-sqlalchemy-db-create-all-raises-runtimeerror-working-outside-of-applicat [수정사항] [성공화면] ** 이후 과정에도 from application import app app.app _context()가.push() 가 계속 필요하네요.