python

package
v0.11.405 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Shell                   = "/bin/sh"
	ShellSubcommandFlag     = "-c"
	VirtualEnvBinaryFolder  = "bin"
	DefaultPythonExecutable = "python3"
)
View Source
const CtxUseWingetForUv = "use_winget_for_uv"

CtxUseWingetForUv is a context key for enabling winget-based uv installation on Windows.

View Source
const (
	LocalIngestr contextKey = "local_ingestr"
)
View Source
const PythonArrowTemplate = `` /* 1092-byte string literal not displayed */
View Source
const WINDOWS = "windows"

Variables

View Source
var AvailablePythonVersions = map[string]bool{
	"3.8":  true,
	"3.9":  true,
	"3.10": true,
	"3.11": true,
	"3.12": true,
	"3.13": true,
}
View Source
var DatabasePrefixToSqlfluffDialect = map[string]string{
	"bq":         "bigquery",
	"sf":         "snowflake",
	"pg":         "postgres",
	"rs":         "redshift",
	"athena":     "athena",
	"ms":         "tsql",
	"databricks": "sparksql",
	"synapse":    "tsql",
	"duckdb":     "duckdb",
	"clickhouse": "clickhouse",
}
View Source
var SupportedIngestrStrategies = []string{
	"replace",
	"append",
	"merge",
	"delete+insert",
}

SupportedIngestrStrategies lists all incremental strategies supported by ingestr.

SupportedPythonMaterializationStrategies lists all materialization strategies supported by Python assets.

View Source
var TypeHintMapping = map[string]string{}/* 154 elements not displayed */

TypeHintMapping maps different destination types to dlt types. 'text' mappings are omitted, since they are the default.

Functions

func AddExtraPackages added in v0.11.161

func AddExtraPackages(destURI, sourceURI string, extraPackages []string) []string

func ColumnHints added in v0.11.405

func ColumnHints(cols []pipeline.Column, normaliseNames bool) string

ColumnHints returns an ingestr compatible type hint string that can be passed via the --column flag to the CLI.

func ConsolidatedParameters added in v0.11.161

func ConsolidatedParameters(ctx context.Context, asset *pipeline.Asset, cmdArgs []string, columnOpts *ColumnHintOptions) ([]string, error)

func DetectDialectFromAssetType added in v0.11.243

func DetectDialectFromAssetType(assetType string) string

DetectDialectFromAssetType extracts the dialect from an asset's type field by splitting on the first dot and mapping the prefix.

func GetSupportedIngestrStrategiesString added in v0.11.359

func GetSupportedIngestrStrategiesString() string

GetSupportedIngestrStrategiesString returns a comma-separated string of supported ingestr strategies.

func GetSupportedPythonStrategiesString added in v0.11.359

func GetSupportedPythonStrategiesString() string

GetSupportedPythonStrategiesString returns a comma-separated string of supported Python materialization strategies.

func IsIngestrStrategySupported added in v0.11.359

func IsIngestrStrategySupported(strategy string) bool

IsIngestrStrategySupported checks if a given strategy string is supported by ingestr.

func IsPythonMaterializationStrategySupported added in v0.11.359

func IsPythonMaterializationStrategySupported(strategy pipeline.MaterializationStrategy) bool

IsPythonMaterializationStrategySupported checks if a given strategy is supported for Python assets.

func NormaliseColumnType added in v0.11.405

func NormaliseColumnType(typ string) string

func NormalizeColumnName added in v0.11.405

func NormalizeColumnName(name string) string

func TranslateBruinStrategyToIngestr added in v0.11.359

func TranslateBruinStrategyToIngestr(strategy pipeline.MaterializationStrategy) (string, bool)

TranslateBruinStrategyToIngestr converts a Bruin materialization strategy to its ingestr equivalent.

Types

type ColumnHintOptions added in v0.11.405

type ColumnHintOptions struct {
	// NormalizeColumnNames converts column names to snake_case (used for CSV/seed assets).
	NormalizeColumnNames bool
	// EnforceSchemaByDefault determines behavior when enforce_schema parameter is not set.
	// If true, schema will be enforced by default (used for seed assets).
	// If false, schema will only be enforced when enforce_schema="true" is explicitly set.
	EnforceSchemaByDefault bool
}

ColumnHintOptions controls how column hints are added to ingestr commands.

type CommandInstance added in v0.11.104

type CommandInstance struct {
	Name    string
	Args    []string
	EnvVars map[string]string
}

type CommandRunner added in v0.11.92

type CommandRunner struct{}

func (*CommandRunner) Run added in v0.11.92

func (l *CommandRunner) Run(ctx context.Context, repo *git.Repo, command *CommandInstance) error

func (*CommandRunner) RunAnyCommand added in v0.11.92

func (l *CommandRunner) RunAnyCommand(ctx context.Context, cmd *exec.Cmd) error

type LocalOperator

type LocalOperator struct {
	// contains filtered or unexported fields
}

func NewLocalOperator

func NewLocalOperator(config config.ConnectionAndDetailsGetter, envVariables map[string]string) *LocalOperator

func NewLocalOperatorWithUv added in v0.11.87

func NewLocalOperatorWithUv(config config.ConnectionAndDetailsGetter, envVariables map[string]string) *LocalOperator

func (*LocalOperator) Run

func (*LocalOperator) RunTask

type ModulePathFinder

type ModulePathFinder struct {
	PathSeparatorOverride int32
}

func (*ModulePathFinder) FindModulePath

func (m *ModulePathFinder) FindModulePath(repo *git.Repo, executable *pipeline.ExecutableFile) (string, error)

func (*ModulePathFinder) FindRequirementsTxtInPath

func (m *ModulePathFinder) FindRequirementsTxtInPath(path string, executable *pipeline.ExecutableFile) (string, error)

type NoRequirementsFoundError

type NoRequirementsFoundError struct{}

func (*NoRequirementsFoundError) Error

func (m *NoRequirementsFoundError) Error() string

type PyprojectToml added in v0.11.243

type PyprojectToml struct {
	Tool struct {
		Sqlfluff map[string]any `toml:"sqlfluff"`
	} `toml:"tool"`
}

type SQLFileInfo added in v0.11.243

type SQLFileInfo struct {
	FilePath string
	Dialect  string
}

type SqlfluffRunner added in v0.11.243

type SqlfluffRunner struct {
	UvInstaller uvInstaller
	// contains filtered or unexported fields
}

func (*SqlfluffRunner) RunSqlfluffWithDialects added in v0.11.243

func (s *SqlfluffRunner) RunSqlfluffWithDialects(ctx context.Context, sqlFiles []SQLFileInfo, repo *git.Repo) error

type UvChecker added in v0.11.87

type UvChecker struct {
	uv.Checker
}

UvChecker handles checking and installing the uv package manager.

type UvPythonRunner added in v0.11.92

type UvPythonRunner struct {
	Cmd         cmd
	UvInstaller uvInstaller
	// contains filtered or unexported fields
}

func (*UvPythonRunner) Run added in v0.11.92

func (u *UvPythonRunner) Run(ctx context.Context, execCtx *executionContext) error

func (*UvPythonRunner) RunIngestr added in v0.11.92

func (u *UvPythonRunner) RunIngestr(ctx context.Context, args, extraPackages []string, repo *git.Repo) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL