본문 바로가기

728x90

superset

[Superset] Color Scheme 추가하기 계속해서 UI 및 기능이 업데이트 되고 있네요... Style > Chart Options > Color Scheme 추가하기 assets/javascripts/modules/colors.js 파일에 export const ALL_COLOR_SCHEMES = { bnbColors, d3Category10, d3Category20, d3Category20b, d3Category20c, googleCategory10c, googleCategory20c, myColors };이 부분에 추가하면 된다.const myColors= [ '#3366cc', '#dc3912', '#ff9900', '#109618'] Color Schema Control 위치는assets/javascripts/explore/compon.. 더보기
[Superset] 'NoneType' object has no attribute 'to_dict' Table 추가 후 컬럼 정보가 안나올 때 조치방법 sqlite 를 사용하여 superset 기본 db 를 제어하면 발생하지 않는다.하지만, mysql 을 연결해서 사용하면 table 추가 시 columns 정보가 출력되지 않고, 딱히 에러 메세지도 출력되지 않아 확인이 힘들다. 확인해본 결과, table_columns 테이블에 column 정보가 입력되지 않아, chart를 그릴 때 위와 같은 에러 메세지가 출력된다. table_columns 테이블의 type 컬럼 사이즈를 늘려주면 해결된다. mariaDB에서 type 이름이 긴 경우 입력이 안되어 발생하는 문제이다. 더보기
[Superset] upgrade 하기(makedirs 에러 조치) > pip install superset --upgrade 1234567891011121314151617181920212223242526Installing collected packages: pandas, webencodings, html5lib, bleach, PyHive, superset, cffi, scandir, pure-sasl Found existing installation: pandas 0.20.3 Uninstalling pandas-0.20.3: Successfully uninstalled pandas-0.20.3 Rolling back uninstall of pandasException:Traceback (most recent call last): File "e:\workspace\py.. 더보기
[Superset] Install 시 에러 발생 처리 ( 0.23.3 버전 ) 12345678910111213 Running setup.py install for python-geohash ... Running command e:\workspace\superset-install\venv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\jh999.lim\\appdata\\local\\temp\\pip-build-wmleww\\python-geohash\\setup.py'; f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))".. 더보기
[Superset] 'module' object has no attribute 'SIGALRM' for windows SQL Lab 에서 'Run Query' 를 실행하거나, Table을 선택하면 Preview for 탭에서 아래와 같은 에러가 발생한다... 'module' object has no attribute 'SIGALRM' 찾아봤지만,,, windows는 지원 안한다고 한다..? signal 소스 코드를 보면 SIGALRM이 없다. Query 수행 시 timeout 시간보다 오래 걸리면 끝내도록 해주는 부분에서 에러가 발생한다. core.py 소스에서 def sel_json() 부분이다. 그래도 실행이 되게끔 해야하니, 주석 처리 하기로 했다.timeout 거는 걸 좀 더 봐야겠지만, 방법은 있을 듯 하다.. python을 잘 모르기 때문에 우선 실행이 되는것만 확인할 수 있게 주석 처리 하니 정상적으로 수행.. 더보기
[Superset][Flask-CORS][CORS] 'Access-Control-Allow-Origin' 해결 Angular2+ 에서 Superset API 호출 시 No 'Access-Control-Allow-Origin' header is present on the requested resource. 에러가 발생한다.결론적으로 다른 도메인에서 호출하면 에러가 발생하니 조치가 필요하다. CORS 문제 해결하기 위해 Flask-CORS 설치가 필요하다. supserset/config.py 에서#CORS OptionsENABLE_CORS = True 로 변경하고 재시작 해보면 flask_cors 가 없다고 나온다. ■ 해결방법 1. superset[cors] 설치> pip install superset[cors] 2. config.py 에 설정 - ENABLE_CORS = True ==> The value of t.. 더보기
[Superset] Slice Visualization Type 추가하기 Slice Visualiation Type 중 filter_box를 변경하기 위해 Visualization Type을 새로 추가하였다.기존 filter_box는 변경하지 않고 새로운 Type을 추가하는 방법을 택하였다. 기존 filter_box 형태는 Date Filter(Since, Until 필터)와 Filter Controls 가 아래의 그림과 같이 출력된다. superset/vis.py 에 class를 추가한다.class FilterBoxViz(BaseViz):FilterBoxViz를 복사하여 사용한다. 복사 후 이름을 원하는 대로 변경한다.class CustomFilterBoxViz(BaseViz): """A multi filter, multi-choice filter box to make da.. 더보기
[Superset][ReactJS] UI 수정 후 빌드 및 배포하기 Superset 화면 수정 후 빌드 및 배포하는 방법 입니다. 화면 수정 하기 참고 이전 내용에서 보면 > webpack --env dev --watch --colors --progress --debug --output-pathinfo --devtool inline-source-map 위 명령을 실행하면 소스가 변경될 때 마다 build를 다시 하는걸 알 수 있다.dist 폴더에 build 된 내용이 추가된다. production 빌드는 package.json 에 script > prod 을 보면"prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js -p --colors --progre.. 더보기

728x90