[PostgreSQL] ON CONFLICT ERROR (there is no unique or ~)
·
Develop/Database
상황ON CONFLICT ~ DO UPDATE ~ 수행 시 다음과 같은 에러 출력더보기there is no unique or exclusion constraint matching the ON CONFLICT specification원인Primary Key, Unique Key가 정의 되어 있지 않아 발생해결Unique Key 추가ALTER TABLE [MY_TABLE]ADD CONSTRAINT unique_datetime_tag_name UNIQUE (datetime, tag_name);
[Python] 기상청 API Hub의 날씨 & 날씨 예보 데이터 수집 with. airflow
·
Develop/Python
KimGeunUk/airflow-weather: Weather & Weather Forecast Data Pipeline With Apache Airflow GitHub - KimGeunUk/airflow-weather: Weather & Weather Forecast Data Pipeline With Apache AirflowWeather & Weather Forecast Data Pipeline With Apache Airflow - KimGeunUk/airflow-weathergithub.com 오탈자, 에러, 수정 제안이 있으시다면 댓글 부탁드립니다.
[Python] Airflow Dag 정보 (Task Context) 전달
·
Develop/Python
...from train_model.main import runlocal_tz = pendulum.timezone("Asia/Seoul")...dag = DAG( dag_id='train_model_dag', default_args=default_args, schedule_interval='30 9 * * *', # 매일 09:30 실행 catchup=False)process_task = PythonOperator( task_id='train_model', python_callable=run, dag=dag) 위와 같이 간단한 dag을 구성 후 train_model의 run 함수에서 airflow에서 작업을 수행한 시간인 execution_date를 가져오고 싶었다..
[Docker] PostgreSQL 설치
·
Develop/Docker
도커 실행docker pull postgres:latestdocker run --name postgres -p [PORT]:5432 -e POSTGRES_USER=[USER] -e POSTGRES_PASSWORD=[PASSWORD] -d postgres 내부 접속docker exec -it postgres /bin/bash Database 목록 확인접속psql -U postgres명령어\l 외부 접속# //[PostgreSQL ID]:[PostgreSQL PWD]@[HOST IP]:[PORT]/[DB NAME]export DB_URL = 'postgresql://postgres:1@127.0.0.1:5432/postgres
[Git] 삭제된 폴더, 파일 반영
·
Develop/Git & GitHub
git add 시 로컬에서 삭제한 폴더나 파일이 반영되지 않는 경우가 있다. 이를 해결하기 위해 다음 명령어를 사용한다.git add -u [file or .] 추가로, commit 시 -a 옵션을 사용하면 삭제된 폴더, 파일만 반영된다.git commit -a -m "feat: ..."
[Python] Windows에 pyenv 설치
·
Develop/Python
프로젝트마다 사용하는 python 버전이 달라질 수 있으므로, pyenv를 사용하기로 결정 1. 설치https://github.com/pyenv-win/pyenv-win GitHub - pyenv-win/pyenv-win: pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch betpyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the U..
간단한 Airflow 환경 구축 (dockerfile)
·
ML & DL/Practice
WSL2 Ubuntu 환경에서 실행하였습니다. apt 업데이트sudo apt updatesudo apt install sudo프로젝트 폴더 권한 부여sudo chown -R [사용자 계정명] [프로젝트 디렉토리]파이썬 설치sudo apt install python3가상환경 생성 (프로젝트 디렉토리에서)sudo apt install python3-venvpython3 -m venv venvsource venv/bin/activateairflow 라이브러리 설치pip install apache-airflowairflow 세팅 및 실행 (프로젝트 디렉토리에서)export AIRFLOW_HOME=$PWD/airflowairflow db initsed -i 's/^load_examples = True/load_e..
[Tistory] hELLO. 스킨 카테고리 접기 펼치기 수정
·
끄적 끄적
카테고리 목록에서 서브 카테고리가 있는 경우, 클릭 시 페이지 이동 없이 펼쳐볼 수 있도록 스킨을 수정했습니다. 스킨 편집에서 HTML > body 아래에 다음 코드를 추가합니다.
욱근욱