Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Conversation

@sfenner-eb
Copy link

Comparing across forks, not to merge

snowflake = import_snowflake()
logging.getLogger("snowflake.connector").setLevel(logging.WARNING)

with open("/Users/sfenner/.ssh/snowflake_rsa_key.p8", "rb") as key:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def don't want this :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps there is a more generic way to do this type of thing......


class Presto(Database):
def __init__(self, host, port, database, user, password):
def __init__(self, host, port, user, password, schema, database, print_sql=True):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can update this signature to pass in "extra" args, then pass those extra args to prestodb.dbapi.connect might be a lighter weight change.

Copy link
Contributor

@sirupsen sirupsen Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think excess kw should just be passed straight to the driver, also where we'd pass paths, etc. in the absence of a config file (so far)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is out-dated

try:
role = dsn.query['role']
except KeyError:
raise ValueError(f"Must provide role. Expected format: '{HELP_SNOWFLAKE_URI_FORMAT}'")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the Snowflake constructor throw a similar error? I assume it is ok with out one for users that have a default role assigned.

That isn't true in our case and we'd like to pass that along, but maybe isn't quite the same as the other objects like warehouse, database, and scheme....... Not sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is out-dated

from runtype import dataclass

from .sql import Select, Checksum, Compare, DbPath, DbKey, DbTime, Count, TableName, Time, Min, Max, ColumnName
from .sql import Select, Checksum, Compare, DbPath, DbKey, DbTime, Count, TableName, Time, Min, Max, ColumnName, Compiler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see Compiler used in this file. We should take this out.

@property
def _relevant_columns(self) -> List[str]:
extras = set(map(ColumnName, self.extra_columns))
extras = set(self.extra_columns)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not clear on what we wanted to move this map(ColumnName part to latter in the function, can you clarify?

def compile(self, c: Compiler):
compiled_exprs = ", ".join(c.database.to_string(s) for s in map(c.compile, self.exprs))
expr = f"concat({compiled_exprs})"
compiled_exprs_raw = [c.database.to_string(s) for s in map(c.compile, self.exprs)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide an example here or in the description of what prompted this change?

@sfenner-eb sfenner-eb closed this Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants