dabla commented on PR #40751:
URL: https://github.com/apache/airflow/pull/40751#issuecomment-2230111183

   @potiuk @eladkal 
   
   I've fixed the AttributeError: type object 'SkipDBTestsSession' has no 
attribute 'get_bind' as follow:
   
   ```
   class SkipDBTestsSession:
       """
       This fake session is used to skip DB tests when `_AIRFLOW_SKIP_DB_TESTS` 
is set.
   
       :meta private:
       """
   
       def __init__(self):
           raise AirflowInternalRuntimeError(
               "Your test accessed the DB but `_AIRFLOW_SKIP_DB_TESTS` is 
set.\n"
               "Either make sure your test does not use database or mark the 
test with `@pytest.mark.db_test`\n"
               "See 
https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst#";
               "best-practices-for-db-tests on how "
               "to deal with it and consult examples."
           )
   
       def remove(*args, **kwargs):
           pass
   
      # added dummy get_bind method here to fix the issue
       def get_bind(
           self,
           mapper=None,
           clause=None,
           bind=None,
           _sa_skip_events=None,
           _sa_skip_for_implicit_returning=False,
       ):
           pass
   ```
   
   I find it weird I have the same issue accross my different PR but I've 
checked other Pr and they don't have it...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to