Coder Social home page Coder Social logo

Comments (12)

mpgreg avatar mpgreg commented on June 26, 2024 1

As Tamara noted... snowflake connector changed in 4.0.2: https://airflow.apache.org/docs/apache-airflow-providers-snowflake/stable/index.html#id2. Will post a PR here shortly.

from airflow-provider-great-expectations.

denimalpaca avatar denimalpaca commented on June 26, 2024 1

@Bowrna I'm releasing a fix from @mpgreg 's PR, this should resolve the issue.

I don't feel we've come to a resolution about the account key error. I do think that as long as a Snowflake account is provided to the connection, this shouldn't be a problem in any Airflow version.

from airflow-provider-great-expectations.

denimalpaca avatar denimalpaca commented on June 26, 2024 1

Hi @Bowrna I just released version 0.2.5 with this fix. Will close the issue!

from airflow-provider-great-expectations.

Bowrna avatar Bowrna commented on June 26, 2024

The above issue occur in the latest version of the great-expectations-operator too:
Following is the log trace for it

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/great_expectations_provider/operators/great_expectations.py", line 474, in execute
    self.build_runtime_datasources()
  File "/usr/local/lib/python3.8/site-packages/great_expectations_provider/operators/great_expectations.py", line 383, in build_runtime_datasources
    self.datasource = self.build_runtime_sql_datasource_config_from_conn_id()
  File "/usr/local/lib/python3.8/site-packages/great_expectations_provider/operators/great_expectations.py", line 320, in build_runtime_sql_datasource_config_from_conn_id
    "connection_string": self.make_connection_string(),
  File "/usr/local/lib/python3.8/site-packages/great_expectations_provider/operators/great_expectations.py", line 255, in make_connection_string
    "account", self.conn.extra_dejson["extra__snowflake__account"]
KeyError: 'extra__snowflake__account'

from airflow-provider-great-expectations.

denimalpaca avatar denimalpaca commented on June 26, 2024

#84 should have closed this issue - can you please confirm you're using the operator version 0.2.4?

from airflow-provider-great-expectations.

denimalpaca avatar denimalpaca commented on June 26, 2024

@Bowrna can you confirm this is still an issue with the newest version? Thanks

from airflow-provider-great-expectations.

Bowrna avatar Bowrna commented on June 26, 2024

@denimalpaca this issue is persisting in the version airflow-provider-great-expectations==0.2.4

I have verified it again

from airflow-provider-great-expectations.

Bowrna avatar Bowrna commented on June 26, 2024

I have verified the code in this link https://github.com/astronomer/airflow-provider-great-expectations/blob/main/great_expectations_provider/operators/great_expectations.py#L253-L266

snowflake_account = self.conn.extra_dejson.get(
                "account", self.conn.extra_dejson["extra__snowflake__account"]
            )

in latest version of airflow, self.conn.extra_dejson dict doesn't have the key "extra__snowflake__account". so the above code starts to throw error.

We could handle it by changing the code like below

snowflake_account = self.conn.extra_dejson.get(
                "extra__snowflake__account", self.conn.extra_dejson.get("account", None)
            )

from airflow-provider-great-expectations.

denimalpaca avatar denimalpaca commented on June 26, 2024

I think that code should throw and error when no account is specified; do you think the wrong error is being thrown? The key error KeyError: 'extra__snowflake__account' should only occur now if no account is given. I don't think your fix would provide the correct behavior, as the error would then be propagated to the Great Expectations libraries when an invalid URI is passed.

Are you unable to use the operator because of the current behavior?

from airflow-provider-great-expectations.

Bowrna avatar Bowrna commented on June 26, 2024

I think that code should throw and error when no account is specified; do you think the wrong error is being thrown? The key error KeyError: 'extra__snowflake__account' should only occur now if no account is given. I don't think your fix would provide the correct behavior, as the error would then be propagated to the Great Expectations libraries when an invalid URI is passed.

Are you unable to use the operator because of the current behavior?

Yes, i am unable to use the operator because of the current behavior. I had to run the snowflake query in separate task and pass the result to the GX operator rather than passing the snowflake query directly to GX operator

from airflow-provider-great-expectations.

mpgreg avatar mpgreg commented on June 26, 2024

PR for this #95

from airflow-provider-great-expectations.

Bowrna avatar Bowrna commented on June 26, 2024

thanks @denimalpaca
yes this fix should solve the issue

from airflow-provider-great-expectations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.