YAML
-
[Airflow] DAG에서 같은 yaml 파일 중복 사용시 ErrorAirflow 2022. 3. 21. 20:58
1. crontab OFF 상태에서 git_pull_clients Task 실행 시 ⇒ error 발생수동 git fetch —all ⇒ update_clients ⇒ errorup_for_retry에 걸려있음clients.yml은 변경(서비스키 삭제)된 상태 2. crontab ON 상태에서 update_clients Task 실행 시 ⇒ error 발생 clients.yml update 후 crontab 작동할 때 까지 대기 ⇒ 변경 전 clients.yml pull 땡긴 후 nothing to commit, working tree clean error 발생⇒ DAG가 돌아가는 중에 혹은 어떤 작업 진행 중 CONF repo에 변경사항이 반영되면 git pull을 요구하기 때문에 error가 발생함...
-
UnicodeEncodeError: 'ascii' codec can't encode characters개발Tip 2022. 3. 6. 00:41
기존 yaml 파일의 코드를 수정하기 위해 write를 시도해봤더니 아래와 같은 에러가 나왔다: File "/data/airflow/../delete_serviceKey_dag.py", line 45, in get_client_names outfile.write('\\n\\n\\n'.join(new_clients)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 449-453: ordinal not in range(128) =>file을 열고 작성할 때 open과 write 둘다 encoding이 필요하다 with open('/data/airflow/G2-CONF/clients.yml', encoding="utf-8") as ..