-
Notifications
You must be signed in to change notification settings - Fork 139
Fix autogenerated metrics #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix autogenerated metrics #15
Conversation
Updating shopkick master
…sue with auto-generated sum/avg metrics
Thank you @kuriancheeramelil The error:
For joins we need to prefix the column name with the table name. Not sure what's the best way to deal with this. |
Thank you @mxmzdlv for looking into this. |
@mxmzdlv, could you please check if the alternate approach is good? |
Awesome, this approach passes all the tests! Have you tried it with Superset — does it work without any issues? |
Its working with superset. The autogenerated metrics are syntactically correct as well now. |
Thanks! |
I'm working on getting 100% unit-test coverage and am wondering if this change is still needed. I tried to test this in superset. What I did in superset:
I tried both removing the lines and adding a break point in the Can you explain how you triggered the problem in Superset? Is this still needed? |
Hi @jimfulton, This fix was done for one of our customers at that time. Thanks, |
@kuriancheeramelil Thanks. Do you recall how you reproduced the issue at the time? |
At that time, the issue was there for all datasets pointing to BigQuery, maybe it was due to the specific version of google-cloud-bigquery we used at that time. The version we used was 0.28.0 I am also pasting below the Dockerfile which we used to build the superset docker image. If you could build the image and test using that you might be able to reproduce the issue.
Also attaching the files which the Dockerfile references Thanks |
Thanks!
Jim
…On Fri, May 7, 2021 at 12:29 AM kuriancheeramelil ***@***.***> wrote:
@jimfulton <https://github.com/jimfulton> ,
At that time, the issue was there for all datasets pointing to BigQuery,
maybe it was due to the specific version of google-cloud-bigquery we used
at that time. The version we used was 0.28.0
I am also pasting below the Dockerfile which we used to build the superset
docker image. If you could build the image and test using that you might be
able to reproduce the issue.
FROM centos:7
Superset version
ARG SUPERSET_VERSION=0.22.1
Configure environment
ENV PYTHONPATH=/etc/superset/conf:$PYTHONPATH
SUPERSET_VERSION=${SUPERSET_VERSION}
PYBIGQUERY_VERSION=0.2.5
BIGQUERY_VERSION=0.28.0
SUPERSET_HOME=/home/superset
Create superset user & install dependencies
RUN useradd -U -m superset &&
yum upgrade -y python-setuptools &&
yum install -y gcc gcc-c++ libffi-devel python-devel python-wheel
openssl-devel libsasl2-devel openldap-devel mariadb-devel curl epel-release
&&
yum install -y python2-pip &&
find / -name '*pip*' &&
pip install --upgrade setuptools pip &&
pip install superset==${SUPERSET_VERSION}
pybigquery==${PYBIGQUERY_VERSION} mysqlclient flask_oauthlib
google-cloud-bigquery==${BIGQUERY_VERSION} requests &&
pip install pyasn1 pyasn1-modules --upgrade
COPY db_engine_specs.py
/usr/lib/python2.7/site-packages/superset/db_engine_specs.py
COPY sqlalchemy_bigquery.py
/usr/lib/python2.7/site-packages/pybigquery/sqlalchemy_bigquery.py
Configure Filesystem
WORKDIR /home/superset
Deploy application EXPOSE 8088
HEALTHCHECK CMD ["curl", "-f", "http://localhost:8088/health"]
ENTRYPOINT ["superset"]
CMD ["runserver","-t","120","-w","14"]
USER superset
Also attaching the files which the Dockerfile references
Archive.zip
<https://github.com/googleapis/python-bigquery-sqlalchemy/files/6439459/Archive.zip>
Thanks
Kurian
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF4U57TCTA6A773ZJ4PPW3TMOCDRANCNFSM4E55BF7A>
.
--
Jim Fulton
http://jimfulton.info
|
Auto generated sum/avg metrics in superset shows sum/avg expression as
which is syntactically wrong in BQ.
To fix it have overwritten the visit_column method of SQLCompiler in BigQueryCompiler to set include_table parameter which is true by default to false. When this is done, the sum expression becomes
Could you please check if the fix is good and merge it.