Skip to content
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

inject query comments (#1643) #1864

Merged
merged 8 commits into from
Nov 4, 2019
Merged

Commits on Nov 4, 2019

  1. inject query comments

    Make a fake "macro" that we parse specially with a single global context
    Macro takes an argument (the node, may be none)
    Users supply the text of the macro in their 'user_config' under a new 'query_comment'
    No macros available
    query generator is an attribute on the connection manager
     - has a thread-local comment str
     - when acquiring a connection, set the comment str
    new 'connection_for' context manager: like connection_named, except also use the node to set the query string
    Updated unit tests to account for query comments
    Added a hacky, brittle integration test
      - log to a custom stream and read that
    Trim down the "target" context value to use the opt-in connection_info
     - Make sure it contains a superset of the documented stuff
     - Make sure it does not contain any blacklisted items
    Change some asserts to raise InternalExceptions because assert error messages in threads are useless
    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    ff158b8 View commit details
    Browse the repository at this point in the history
  2. Move query comments into the project config

    Add special handling to 'dbt debug' for this behavior
    Rework the dependencies/requirements for adapters since they now require more of a config object
    tests...
    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    5b6586d View commit details
    Browse the repository at this point in the history
  3. less query commenting

    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    15ff08d View commit details
    Browse the repository at this point in the history
  4. use block-style comments per PR feedback

    Fix the tests
    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    57f4221 View commit details
    Browse the repository at this point in the history
  5. move macro stuff around

    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    1873f40 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    84d585c View commit details
    Browse the repository at this point in the history
  7. pin urllib3 to a version that snowflake supports

    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    ab9fcb4 View commit details
    Browse the repository at this point in the history
  8. if the comment macro is null/empty, no comments

    Jacob Beck committed Nov 4, 2019
    Configuration menu
    Copy the full SHA
    b56d93b View commit details
    Browse the repository at this point in the history