Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
register_pattern(
SemverString,
r'^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(\.(?:0|[1-9]\d*))?$',
)
@dataclass
class Quoting(JsonSchemaMixin, Mergeable):
identifier: Optional[bool]
schema: Optional[bool]
database: Optional[bool]
project: Optional[bool]
@dataclass
class Package(Replaceable, HyphenatedJsonSchemaMixin):
pass
@dataclass
class LocalPackage(Package):
local: str
@dataclass
class GitPackage(Package):
git: str
revision: Optional[str]
warn_unpinned: Optional[bool] = None
@dataclass
'schema',
'source',
'sql',
'sql_now',
'store_result',
'target',
'this',
'tojson',
'try_or_compiler_error',
'var',
'write',
}
@dataclass
class Project(HyphenatedJsonSchemaMixin, Replaceable):
name: Name
version: Union[SemverString, float]
project_root: Optional[str] = None
source_paths: Optional[List[str]] = None
macro_paths: Optional[List[str]] = None
data_paths: Optional[List[str]] = None
test_paths: Optional[List[str]] = None
analysis_paths: Optional[List[str]] = None
docs_paths: Optional[List[str]] = None
target_path: Optional[str] = None
snapshot_paths: Optional[List[str]] = None
clean_targets: Optional[List[str]] = None
profile: Optional[str] = None
log_path: Optional[str] = None
modules_path: Optional[str] = None
quoting: Optional[Quoting] = None
def set_values(self, cookie_dir):
if self.send_anonymous_usage_stats:
tracking.initialize_tracking(cookie_dir)
else:
tracking.do_not_track()
if self.use_colors:
printer.use_colors()
if self.printer_width:
printer.printer_width(self.printer_width)
@dataclass
class ProfileConfig(HyphenatedJsonSchemaMixin, Replaceable):
profile_name: str = field(metadata={'preserve_underscore': True})
target_name: str = field(metadata={'preserve_underscore': True})
config: UserConfig
threads: int
# TODO: make this a dynamic union of some kind?
credentials: Optional[Dict[str, Any]]
@dataclass
class ConfiguredQuoting(Quoting, Replaceable):
identifier: bool
schema: bool
database: Optional[bool]
project: Optional[bool]