All Articles

TIL&TEL 23.01.09~23.01.15

TIL( Today I Learned)

23-01-09 월

  • WORKPLACE

    • PHASE 1 9-12 / 6

      • 디버깅 왜 안되지… ???

        • 환경
        • 디버깅 모드
    • PHASE 2 13-16 / 6

      • pytest 세팅하기
    • PHASE 3 16-18 / 4

23-01-10 화

  • PHASE 1 9-12 / 6

    • pytest 세팅하기

      • asyncpg 에러

        • async pg pool
  • PHASE 2 13-16 / 6
  • PHASE 3 16-18 / 4

23-01-11 수

  • WORKPLACE

    • PHASE 1 9-12 | 6

      • api mig | 5 | 4
    • PHASE 2 13-16 | 6

      • api mig | 2 | 2

        • prophet 에러 발생
        • flask api 에러
      • 14시 회의 | 4
    • PHASE 3 16-18 | 4

23-01-12 목

  • WORKPLACE

    • PHASE 1 9-12 | 6

      • api mig | 4 |

        • flask -> drex 배포
        • Dockr cmd 세팅 바꿔보기
      • docker 문제문제

        • 외부포트
    • PHASE 2 13-16 | 6

      • 차트 라이브러리 찾아보기

        • 검색기준 세워보기
        • 기준에 맞게 채점하기
    • PHASE 3 16-18 | 4

23-01-13 금

  • WORKPLACE

    • PHASE 1 9-12 | 6

      • Config -> .env
      • docker secret
    • PHASE 2 13-16 | 6

    • PHASE 3 16-18 | 4

      • 실제 데이터 연결하기
      • 이상치 검출 주기적으로 동작 시키기
      • 필요한 테이블 마이그레이션 하기

TEL (Trial and Error Log)

23-01-09

  • ERROR: RuntimeWarning: coroutine ‘PoolConnectionHolder.release’ was never awaited

    • SITUATION:

      • AsyncpgPool.select
    • REASON:

      • 이벤트 루프 문제

    • SOLUTION:

      • @pytest.fixture(scope="session")
        def event_loop(request):
            loop = asyncio.get_event_loop_policy().new_event_loop()
            yield loop
            loop.close()

23-01-10

  • ERROR: TypeError: trio.run received unrecognized yield message .

    • SITUATION:

      • pytest async client
    • REASON:

      • asyncpg not support trio
    • SOLUTION:

      • @epytest.mark.asyncio <= @pytest.mark.anyio
  • ERROR: AttributeError: ‘async_generator’ object has no attribute ‘get’

    • SITUATION:

      • pytest fixture async client
    • REASON:

      • pytest fixture not support asynchronous type
    • SOLUTION:

      • @pytest_async.fixture <= @pytest.fixture
  • ERROR: asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress

    • SITUATION:

      • pytest asyncio
    • REASON:

      • event_loop 여러개 생성됨
    • SOLUTION:

      • event_loop 고정
      • import asyncio
        import pytest
        
        @pytest.yield_fixture(scope="session")
        def event_loop(request):
        loop = asyncio.get_event_loop_policy().new_event_loop()
        yield loop
        loop.close()
  • ERROR: init validate fail

    • SITUATION:

      • python builtin lib dataclass init
    • REASON:

      • attr having default value should be come first
    • SOLUTION:

23-01-11

  • ERROR: has incompatible type “function”; expected “Callable[…, Any]”

    • SITUATION:

      • mypy, set type callable to function
    • REASON:

      • 함수를 던져주는것은 Callable 하지 않게 취급됨
    • SOLUTION:

      • Callable 지움

23-01-12

  • ERROR: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory

    • SITUATION:

      • docker build images
    • REASON:

      • lib not installed
    • SOLUTION:

      • RUN apt-get update && apt-get install libtbb2