sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
bfbd46b7f9a0fc50788f2a2216412f10777f759e734a48ce23cb66cf05a6a186
Rust
9,759
295
use std::process; use dbt_metricflow::{ Dialect, InMemoryMetricStore, SemanticQuerySpec, compile, parse_group_by_str, parse_order_by_str, }; fn main() { let args: Vec<String> = std::env::args().collect(); if args.len() < 2 || args[1] == "--help" || args[1] == "-h" { print_help(); retu...
489df9b153237b555879afd55507bd8983d02e614c1e436b00138c83f6877c9b
Rust
9,859
272
//! Epoch-append parquet for parse-time declared column metadata. //! //! Files land at: //! ```text //! target/ //! metadata/parse/columns/v1_{N}.parquet ← epoch-append, latest-wins by unique_id //! ``` //! //! ## Design //! * Mirrors `compile/columns` but written at **parse** time from YAML declarations. //! * Co...
05692cb1bf7f0b8d311e555b112c395d68816d0b50fa1105d7c2616fd031e227
Rust
9,863
263
//! Epoch-append parquet for parse-time test metadata. //! //! Files land at: //! ```text //! target/ //! metadata/parse/test_metadata/v1_{N}.parquet ← epoch-append, latest-wins by unique_id //! ``` //! //! ## Design //! * One row per test node, written at parse time. //! * Key: `test_unique_id` (the test node's ow...
98b1a05de78699c82a7e81eced398c8f69b3b69d2d6ab30bbc9bfd21788350bf
Rust
9,866
294
//! Weight initialisation strategies for predictive-coding neural networks. //! //! Each function takes a fan-in (`n_parents`) and fan-out (`n_children`) and returns a //! flat `Vec<f64>` of length `n_parents * n_children`, row-major over an //! `(n_children, n_parents)` matrix, that can be used as //! initial coupling...
db8cd59e60c1293b6c523d4b8e543eeaa06001d0d1fef06178b2f5a3d3024d38
Rust
9,874
258
use std::collections::{BTreeMap, BTreeSet, HashMap}; use chrono::Utc; use dbt_adapter::response::AdapterResponse; use dbt_common::ErrorCode; use dbt_common::io_args::EvalArgs; use dbt_common::tracing::dbt_emit::emit_warn_log_message; use dbt_schemas::schemas::RunResultOutput; use dbt_schemas::schemas::manifest::{DbtMa...
897437d551c4fe0f4bb44fc97cc12717f2e9fc27422718c5d02b6c76330dbb40
Rust
9,881
266
//! Non-interactive (headless) construction of profile configurations. //! //! This mirrors the interactive wizard's field schema and value-application //! logic, but collects values from a caller-supplied map instead of prompting. //! It never uses `dialoguer`. use std::collections::HashMap; use dbt_adapter_core::Ad...
00859407800bba12f7732c05c328a23cc1ad84e4ce7baf2e74fd19ff7a1d95e8
Rust
9,957
267
use std::path::Path; use adbc_core::error::{Error as AdbcError, Status}; use dbt_adbc::driver::Builder as DriverBuilder; use dbt_adbc::driver::LoadStrategy; use dbt_adbc::{Backend, Connection, Database, database}; use std::sync::Arc; use crate::IndexError; use crate::format::{cell_to_string, first_nonempty}; /// Tab...
65a26989f666aca664f79fd1a9d308458d07479ac879c2f9bf5c32b56e5de1c2
Rust
9,972
292
use std::collections::BTreeMap; use std::fmt; use std::sync::{Arc, Mutex}; use minijinja::value::{Enumerator, Object, ObjectRepr, Value, ValueKind}; use minijinja::{AutoEscape, Error, State}; use once_cell::sync::OnceCell; use pyo3::prelude::*; use pyo3::pybacked::PyBackedStr; use pyo3::types::{PyDict, PyList, PySequ...
c8e8d308229a3f13eb9c09da2d09bb3f8e3453bca8332177c572ad4caad75050
Rust
9,980
306
// cfg.rs use crate::{compiler::instructions::Instruction, machinery::Span}; use std::collections::BTreeSet; pub type BlockId = usize; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum EdgeKind { FallThrough, Uncond, Cond(bool), } #[derive(Debug, Clone)] pub struct BasicBlock { pub id: BlockId, ...
8c7179b960e242e38fc2b7db5277213cc2bab7ec312954eca6ac23f17ae9f215
Rust
10,029
248
//! Concurrent package resolution: one trait impl per unpinned package kind. //! //! [`PackageResolver::resolve`] checks cancellation then delegates to //! [`PackageResolver::resolve_inner`]. The orchestrator in `compute_package_lock` //! resolves a level concurrently (bounded), then merges transitive deps in sorted //...
144d37c44a763a0dfca1a3c4993beeaff489246f7ab3786b12a1ef75cf3a3ede
Rust
10,049
286
//! Stage attribution for the metadata → information schema conversion. //! //! The conversion is opt-in behind `--generate-info-schema` because its cost is //! unknown. Deciding whether it can be on by default needs cost attributed to //! stages, not just a total: the read, the `payload` JSON parse, the row build //! ...
a6b8b594690260aed3696f16402f89d4b12d3e34c6352435cb37ff98860ebe23
Rust
10,069
354
use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; use std::sync::Arc; use dbt_common::constants::DBT_PROJECT_YML; use dbt_common::tracing::dbt_emit::emit_warn_log_message; use dbt_common::{ErrorCode, FsResult}; use dbt_jinja_utils::serde::value_from_file; use dbt_schemas::schemas::{InternalDbtNode, Node...
435553911e991b84e139a9a8b62fddbadcd461082ab4c96fcdaa41745b7549e3
Rust
10,110
292
use crate::errors::{AdapterError, AdapterErrorKind, AdapterResult}; use crate::relation::config_v2::{ ComponentConfig, ComponentConfigLoader, SimpleComponentConfigImpl, impl_loader, }; use crate::relation::databricks::config::{ DatabricksRelationMetadata, DatabricksRelationMetadataKey, }; use dbt_schemas::schem...
bc88ee4e024c60451ef38dd07fe3a9b631fe7603abe72842e89b659d28476e96
Rust
10,174
277
//! Run-phase `Object` impls — std-only types moved here from //! `dbt-jinja-utils` so the typed run-phase ctx structs can hold them via //! `JinjaObject<T>` rather than opaque `MinijinjaValue`. //! //! Currently moved: `HookConfig`, `LazyModelWrapper`. //! //! Pending later PRs (need handle traits or `dbt-common` deco...
501ed5bbc21d176bdcbea8852dab22d4b788468c69c38450da29173278edf56f
Rust
10,211
332
//! Group 2 of the pre-2.6.0 readiness sweep: the mode x flag applicability //! check existed for sketch-vs-selective-alignment and for the online-only //! knobs, but had never been written for reads-vs-`-a`/`--rad`. ~30 mapping //! flags were accepted there in total silence. //! //! Two of them turned out to be missin...
19523de409e6cc5f9c4cf3f3642381af1d162670e6509ea94d0bc1298a4429b0
Rust
10,236
264
#![cfg(feature = "pycompat")] use minijinja::{context, Environment, Value}; use minijinja_contrib::pycompat::unknown_method_callback; use similar_asserts::assert_eq; fn eval_expr(expr: &str) -> Value { let mut env = Environment::new(); env.set_unknown_method_callback(unknown_method_callback); env.compile_...
a640acabe9e83c4aa852948363aa7d70ab48c2688454891f71597ae522053fb5
Rust
10,283
237
use std::borrow::Cow; use std::collections::BTreeMap; use crate::error::Error; use crate::filters::{self, BoxedFilter}; use crate::output::Output; use crate::tests::{self, BoxedTest}; use crate::utils::{write_escaped, AutoEscape}; use crate::value::Value; use crate::vm::State; pub(crate) fn no_auto_escape(_: &str) ->...
ec9ec31ad993b7d4d351c44c4f28666419bce4fa715d68811045e8591a27f08d
Rust
10,290
310
use dbt_common::{ErrorCode, FsResult, fs_err}; use dialoguer::{Confirm, Input, Password, Select}; use std::collections::HashMap; /// Trait for interactive setup of configuration structs pub trait InteractiveSetup: Clone { /// Get the declarative field definitions for this config type fn get_fields() -> Vec<Con...
c57f634bbb27badaf7ab6ec392734862723921e9bda3c84026e2330a3f05f2b0
Rust
10,310
253
//! Runs external commands with a bounded wait → graceful terminate → //! forceful kill escalation. Discovery probes arbitrary `dbt` installs found //! on `PATH`, so a probe must never be allowed to hang the caller forever //! just because the program it invoked is badly behaved. use std::{ io::Read, process::...
ce9d9af704eaaec95fcd093f33d702276acfd7e091dfc772508ccda51144df1b
Rust
10,427
263
//! A worker retired mid-run must still commit everything observable outside it. //! //! # Why this test exists //! //! Before the thread broker, salmon's mapping pool was fixed: every worker ran //! from the first record to EOF, so "commit my thread-local state at the end" //! and "commit it when the input runs out" w...
66257688ef81c79731be484ea8c3befb2916a50cbaa793ccb0082dbab85abaf9
Rust
10,491
398
use std::collections::BTreeMap; use std::ffi::{c_char, CStr, CString}; use std::mem::{transmute, ManuallyDrop}; use std::ops::Deref; use std::sync::Arc; use minijinja::value::{Object, ValueIter, ValueKind}; use minijinja::{Error, ErrorKind, Value}; use crate::utils::AbiResult; /// Gives a mutable borrow into a value...
9bcba936b09a628c4860d5bad325ff03855222467bff7e3f8466cd8c55aca68a
Rust
10,512
242
//! Online (streaming) inference — the first phase of salmon's dual-phase //! estimator (`processMiniBatch` in `SalmonQuantify.cpp`). //! //! # Why there are two phases //! //! salmon's final abundance estimate comes from an offline EM over equivalence //! classes. But several models the EM depends on — the fragment-le...
874735388a6bafdf512d9081b7e5455e66bcfae9af0f3c3c317de38ee9b7f3e6
Rust
10,526
283
//! Gradient-descent optimisers over the network's weight matrices, mirroring //! the optax transforms the Python `fit` accepts (`optax.sgd`, `optax.adam`). //! They consume the rank-one gradient *factors* from //! [`crate::updates::vectorised::learning`] and form each element `u[i]·v[j]` //! inline, so no gradient mat...
f1aac112e78da2fde5d2fcf1775c0b9de5d0ad622e18e6215c70969a788c0bdc
Rust
10,554
260
//! Shared run diagnostics: bad-input red flags derived from end-of-run //! aggregates (never per-fragment), surfaced to the log and to //! `meta_info.json`'s `diagnostics` array by both the reads and alignment //! quantification paths. //! //! # Why this exists //! //! salmon will happily produce a numerically valid `...
7b01647aeffa806134b5114ab980fd8e282dffa6b8ad5ea66e36199d334d89da
Rust
10,631
323
use std::convert::TryFrom; use minijinja::arg_utils::ArgsIter; use minijinja::value::{Rest, Value, ValueKind}; use minijinja::State; use minijinja::{Error, ErrorKind}; #[cfg(feature = "datetime")] mod datetime; #[cfg(feature = "datetime")] pub use self::datetime::*; /// Returns a plural suffix if the value is not 1...
a05a8be08b82aa943f09abd223e0e51abf355908d624ea4b0dfd78eaee718850
Rust
10,723
293
//! Epoch-append parquet for catalog-time column types and comments. //! //! Files land at: //! ```text //! target/ //! metadata/catalog/columns/v1_{N}.parquet ← epoch-append, latest-wins by unique_id //! ``` //! //! ## Design //! * **Schema versioning** — `v1_` prefix, same pattern as compile/columns. //! * **Delt...
8b9914e06ba321da96c24ed577a921f29182df64db32dd31d57e6b60c11ecca9
Rust
10,791
275
//! This module contains the functions for initializing the Jinja environment for the parse phase. use std::{ collections::{BTreeMap, BTreeSet}, sync::{Arc, Mutex}, }; use chrono::DateTime; use chrono_tz::Tz; use dbt_adapter::{Adapter, sql_types::DefaultTypeOps}; use dbt_adapter_core::*; use dbt_common::{Erro...
7a77a1a8ce5c5ab0adf06058e2c10eb912e08228d81b885d26dd28bdf63819b5
Rust
10,792
303
use std::future::Future; use std::sync::Arc; use dbt_cloud_api::apis::configuration::Configuration; use dbt_platform_auth::{Credential, ResolverKind}; use crate::auth::{PlatformAuth, ResolverConfig, SOURCE_APPLICATION}; use crate::error::Result; /// Default `User-Agent` sent with every request. fn default_user_agent...
0bf8aa0f481b68e096a78c901e96d3fc8c4fbc760d4d1c0e2224403226aa1fe0
Rust
10,794
260
#[cfg(test)] mod tests { use adbc_core::{ error::{Error, Result}, options::AdbcVersion, }; use arrow_array::{ cast::AsArray, types::{Decimal128Type, Int8Type, Int16Type, Int32Type, Int64Type}, }; use arrow_schema::DataType; use dbt_adbc::{Backend, connection, data...
a0693b40d8961f61d8668a4c457ee61c1af82d4ea4d53fb84cbb0b5e3f066f18
Rust
11,049
304
use chrono::{DateTime, Local}; use dbt_telemetry::NodeOutcome; use std::time::{Duration, SystemTime}; use strum_macros::EnumString; // ------------------------------------------------------------------------------------------------ // Trivial Stats, foundation for run-results #[derive(EnumString, PartialEq, Debug, Cl...
9e5a93f5c2d1980f38561b0ecec02025d7e6612ce996c616af535a4b2e8784ac
Rust
11,085
287
//! Append-only parquet for invocation records. //! //! Files land at: //! ```text //! target/ //! metadata/run/invocations/v1_{N}.parquet ← append-only, one row per command //! ``` //! //! ## Design //! * **Append-only** — each invocation appends a new file with exactly one row. //! No deduplication, no latest-w...
6c9c9e9f7d0df89d4c8ec51084058d212c4a1de0ccf76ad13f06a161c9165a7e
Rust
11,108
267
use dbt_common::{AdapterError, AdapterResult}; use dbt_schemas::schemas::{DbtModel, InternalDbtNodeAttributes}; use minijinja::Value; use crate::relation::snowflake::config::{ SnowflakeDescribeResults, get_string_by_name_from_record_batch, }; use crate::{ relation::config_v2::{ ComponentConfig, Compone...
bacd1ca20741f4f0561c62e89ee6dc23d0f22b0f27f506dab55034084a24a0ad
Rust
11,119
366
//! Python model validation //! //! This module validates the structure of Python model files to ensure they follow //! dbt's requirements for Python models. use dbt_common::{ErrorCode, FsResult, err}; use ruff_python_ast::{ self as ast, Stmt, StmtFunctionDef, visitor::{Visitor, walk_stmt}, }; use std::path::P...
4b4b7082c0dfc743a86c4d70d387a1f1adfe82d8d33af8e6afc454a410b7d48c
Rust
11,164
285
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/materialized_view.py use crate::AdapterType; use crate::relation::config_v2::ComponentConfigChange; use crate::relation::config_v2::{ComponentConfigLoader, RelationConfigLoader}; use crate::relation::databricks::config:...
16f1c219c05899cb36ad2d521ca1740098677f7e4cad5a7ad983b917592f7b77
Rust
11,227
351
use super::ir::{ArithmeticOp, ComparisonOp, Expr, Function}; use std::borrow::Borrow; use std::iter::Peekable; use super::tokenize::{Token, tokenize}; pub fn try_parse(s: &str) -> Result<Expr, String> { let mut tokens = tokenize(s).peekable(); let expr = parse_expression(&mut tokens)?; // The parse_expres...
69674c27260d167ce619e95c1b70e1bde0b03a263dc977b4b4333d2e915a0b47
Rust
11,260
407
use insta::assert_snapshot; use minijinja::{ constants::{MACRO_NAMESPACE_REGISTRY, ROOT_PACKAGE_NAME}, context, dispatch_object::DispatchObject, listener::RenderingEventListener, value::{mutable_vec::MutableVec, Object, ValueMap}, Environment, Error as MinijinjaError, ErrorKind, State, Value, };...
0434b980faa66acb0d72e9a360c302e242807d81fb9f252a123f721e44913313
Rust
11,286
431
use std::collections::BTreeMap; use std::fmt; use serde::{ser, Serialize, Serializer}; use crate::error::{Error, ErrorKind}; use crate::utils::untrusted_size_hint; use crate::value::{ value_map_with_capacity, Arc, Packed, Value, ValueMap, ValueRepr, VALUE_HANDLES, VALUE_HANDLE_MARKER, }; use super::mutable_m...
77c722b83f3a348f7ce3f7027e1279bc9ff6afb1154c960d803e7a58a24ec7f5
Rust
11,372
280
//! Exasol metadata adapter. //! //! Provides the schema-creation preflight (`create_schemas_if_not_exists` -> //! `exasol__create_schema`), per-relation schema fetch for unit tests and //! contracts (`list_relations_schemas_inner`, via a zero-row probe — the //! Exasol ADBC driver returns the result schema even for em...
3b51a3cbb409fc82cae1fd7396667178d59731a4c887091e9743c3cd1cb6ccf8
Rust
11,393
261
//! Adapter credentials' config-key alias map. //! //! dbt-core canonicalizes each config source's keys through the active adapter's //! `Credentials._ALIASES` before merging it — in both the rendered //! (`context/context_config.py:222`, `ContextConfigGenerator._update_from_config`) and the //! unrendered (`context/co...
7775631b91974fc0dc99ff5dafc6050d4e1846cecdb35f8272bc75c30a0dbe26
Rust
11,406
328
//! Pushes a rendered Homebrew formula to a tap repo. //! //! Strategy: //! 1. Clone the tap into a temp dir. For HTTPS URLs, auth via //! `git -c http.extraHeader=Authorization: Basic <b64(x-access-token:TOKEN)>` //! — same pattern as actions/checkout. No token in the URL, so logs //! and `git remote ...
acbbf9a595b825ef5cb0db8d556422a3e2242e7410a6b3bddb3caf5140239d7c
Rust
11,451
312
//! Epoch-append parquet for compile-time column types. //! //! Files land at: //! ```text //! target/ //! metadata/compile/columns/v1_{N}.parquet ← epoch-append, latest-wins by unique_id //! ``` //! //! ## Design //! * **Schema versioning** — `v1_` prefix, same pattern as compile/nodes. //! * **Delta writes** — on...
ad02580d58638b3942f15a4fc2d386d82ebcbd1c54e1b1120a42f71320d2a24f
Rust
11,481
286
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
df386c4aef4e7d8b97bd64c04599cc501dc7353a2e1b97d9b1cbbc2f84b438cf
Rust
11,510
321
#![cfg(feature = "builtins")] use std::collections::HashMap; use minijinja::{context, render, Environment, ErrorKind, State, UndefinedBehavior}; use similar_asserts::assert_eq; #[test] fn test_lenient_undefined() { let mut env = Environment::new(); env.add_filter("test", |state: &State, value: String| -> Str...
ba8bc6a3853ad1a7a2a8439400c6fed63aa4e7bf66eff95f6eb6b33eaa4fd598
Rust
11,533
367
use crate::{AdapterConfig, Auth, AuthError, AuthWarningPrinter, auth_configure_pipeline}; use database::Builder as DatabaseBuilder; use dbt_adbc::{Backend, database}; use std::borrow::Cow; const DEFAULT_HOST: &str = "localhost"; const DEFAULT_PORT: &str = "8563"; #[derive(Debug)] enum ExasolAuthIR<'a> { UserPass ...
9ada7a907fdf81b52853a76b98fb35fc08a425d8d714e5d2387b42c481d05d41
Rust
11,570
350
use std::collections::BTreeMap; use std::env; use std::path::PathBuf; use std::sync::Arc; use anyhow::{anyhow, bail, Context, Error}; use clap::ArgMatches; use minijinja::syntax::SyntaxConfig; use minijinja::{AutoEscape, Environment, UndefinedBehavior, Value}; use serde::{Deserialize, Serialize}; /// Overrides specif...
64d8d4776998bba99806d4a3aa82b848d5de7571d1c839cde04dfa5d8a76a5e8
Rust
11,597
352
use crate::config::yml_value_to_string; use crate::{AdapterConfig, Auth, AuthError, AuthWarningPrinter, auth_configure_pipeline}; use database::Builder as DatabaseBuilder; use dbt_adbc::{Backend, clickhouse, database}; use dbt_yaml::Value as YmlValue; use std::borrow::Cow; const DEFAULT_HOST: &str = "localhost"; cons...
6f84e0f109a99bb19a7106d2c94ded08e27ca179b2c221d8346bb09a288b39fd
Rust
11,604
354
use serde::{Deserialize, Serialize}; use strum::{AsRefStr, Display, EnumIter, EnumString, IntoEnumIterator, IntoStaticStr}; pub mod config_aliases; pub const NON_EXPERIMENTAL_ADAPTERS: &[AdapterType] = &[ AdapterType::Snowflake, AdapterType::Bigquery, AdapterType::Databricks, AdapterType::Redshift, ...
36bc1c7437053b8e559f6921e7496a6452dbbba7f05891d5b58d8eb830b72e5a
Rust
11,627
317
use dbt_common::io_args::IoArgs; use dbt_common::path::DbtPath; use dbt_common::{ ErrorCode, FsResult, constants::{DBT_DEPENDENCIES_YML, DBT_PACKAGES_YML}, fs_err, stdfs, }; use dbt_jinja_utils::serde::from_yaml_raw; use pathdiff::diff_paths; use std::{ collections::{BTreeMap, BTreeSet}, io::Read, ...
bc1b80a4ec85facf9d2ed40f7888b386ccdb4ed0f51d4f964bafb3ef05869857
Rust
11,690
326
use dbt_adapter::{Adapter, column::ColumnStatic, relation::factory::create_static_relation}; use dbt_common::{ErrorCode, FsError, FsResult, fs_err}; use minijinja::{ Environment, Error as MinijinjaError, State, Template, UndefinedBehavior, Value, listener::RenderingEventListener, value::{ValueMap, mutable_m...
2ad6323f87b493fc0d2516421f496eb456230240a8d0f7ede1e68a5262ee625f
Rust
11,692
290
//! Static site export. //! //! Turns an index directory of parquet artifacts into a directory of plain files //! that any file host can serve: no process, no API, no state. The browser loads //! DuckDB-WASM from a CDN and queries the parquet directly, so everything the //! former REST API computed server-side is compu...
2f90e5526cdea1953650349a2d3f57123e9a9a3564284991075a25c4b288bc04
Rust
11,700
337
use std::collections::HashSet; use crate::{ AuthError, Credential, resolver::{ AuthResolver, CloudYamlResolver, EnvVarResolver, OAuthInteractiveResolver, OAuthPassiveResolver, ResolverKind, }, }; /// OAuth client ID registered with dbt platform. /// See lsp/src/registration/webAuth/constan...
0335fbaa41da68245202430abeac15ddaa785d6d5a86752197c287d3be628521
Rust
11,754
307
//! The adapters a run can execute on: one per adapter type the active target //! declares. use std::collections::HashMap; use std::sync::{Arc, Mutex}; use dbt_adapter_core::AdapterType; use dbt_common::{ErrorCode, FsResult, fs_err}; use crate::Adapter; /// How the store builds an adapter it has not built yet. /// ...
b6e60966fd16c60f522eb7f7c0d417dfea1d09b926e0aa394c1bcd6abeb671d6
Rust
11,808
293
//! SPA asset delivery. //! //! Two sources, in priority order: //! //! 1. **A generated site directory on disk** ([`serve_site_dir`]). This is what //! `dbt docs serve` uses. Only this source has the `window.__DBT_DOCS__` //! bootstrap injected and the `info_schema/v<n>/` artifacts alongside it, so //! it is ...
d9eef0c1c9bb9b767ea3ed43db7ebcd2ac5c686b270c8e5def206b403bda9e18
Rust
11,808
325
//! Configured Var is a function that resolves a var in the current package's namespace use std::{collections::BTreeMap, rc::Rc, sync::Arc}; use crate::DbtVars; use crate::utils::yml_value_to_minijinja; use indexmap::IndexMap; use minijinja::{ Error, ErrorKind, State, Value, constants::TARGET_PACKAGE_NAME, l...
85577a95171ff0567cd2ca4282a169bc1f206261de21219144b00659fac18829
Rust
11,852
289
//! Rendering-based checker for mangled ref/source calls. //! //! A mangled ref/source is one where the `{{ ref() }}` or `{{ source() }}` call //! is directly adjacent to other content without whitespace separation. //! //! Examples of mangled refs: //! - `foo{{ ref('a') }}` - identifier characters before ref //! - `{{...
936e89d87f62ff4b2f2d1a8d95c4f84a1a663e57490d09b11919d119428e489f
Rust
11,869
274
use dbt_telemetry::{ ConnectionLimitWait, HookProcessed, Invocation, InvocationMetrics, NodeEvaluated, NodeEvent, NodeOutcome, NodeProcessed, NodeSkipReason, SourceFreshnessOutcome, has_node_warning, node_processed::NodeOutcomeDetail, }; use dbt_tracing::{LogRecordInfo, SeverityNumber, SpanEndInfo}; use su...
a37bd5101169248d9e51a85730b55468ca78a168c3c9a15a3439cad0ade248c7
Rust
11,893
319
use std::cell::Cell; use std::io::{self, Write}; use std::process::ExitCode; use std::sync::Arc; use clap::error::ErrorKind; use dbt_clap_core::Cli; use dbt_clap_core::CliParser; use dbt_clap_core::commands::CoreCommand; use dbt_common::FsResult; use dbt_common::cancellation::CancellationReport; use dbt_common::io_ar...
ee02e653f033f81ab7572dc1b88f9a1f02f053c4abf5fa5c73c6e7363bc4eb57
Rust
11,917
337
//! Semantic categorization of adapter operations. //! //! This module classifies adapter methods by their side effects, //! enabling dependency analysis based validation during replay. use serde::{Deserialize, Serialize}; /// Semantic category of an adapter operation. /// /// These categories enable dependency analy...
5808978ba2972ab3ce42e27394d3905edd673ff9eaa0e6fe40c70f1dbd78001e
Rust
11,921
324
//! Canonical definition of the index view surface and its DDL generator. //! //! The single owner of *which views exist* over the index parquet: one base //! view per table, plus the analytical convenience views. Consumers generate //! their statements from here rather than carrying their own lists (fs#13788): //! liv...
030cd5cb5ca49903b0aafffa72767d213aa5ba0a8db38f339e780ac6412ac732
Rust
11,943
338
use std::any::Any; use std::fmt; use clap::error::ErrorKind; use dbt_common::FsResult; use dbt_common::io_args::{EvalArgs, FsCommand, Phases, StaticAnalysisKind, SystemArgs}; use strum_macros::Display; use crate::{ BuildArgs, CheckArgs, CleanArgs, CloneArgs, CommonArgs, CompileArgs, CompletionsArgs, DebugArgs...
65fba20f61d82f00781ac085f7cf0f43e5e814eb9ffba93379f8c0261c92a714
Rust
11,972
243
use crate::model::network::Network; /// Floor on the total predicted variance (carried + volatility + value-coupling): /// at λ = 0 the carried term vanishes (precision can diverge as Ω → 0); at λ = 1 /// the sum already exceeds it. Mirrors `pyhgf.updates.prediction.continuous`. pub const MIN_PREDICTED_VARIANCE: f64 =...
cad07adc2bfd1be7c189902784979721437168840f4c1f7551d69a8d84d55768
Rust
12,066
327
//! Stage-attributed benchmark for the metadata → information schema conversion. //! //! `--generate-info-schema` is opt-in because its cost is unknown. Two decisions //! need numbers: whether the conversion can be on by default, and whether a //! DuckDB-side materializer should replace the Arrow one. [`run_with`] time...
7a859664e87592de61a76bb058a6dc9a4eafffa96be91ace89c19daf48a47ec5
Rust
12,110
314
//! Append-only parquet for source freshness check records. //! //! Files land at: //! ```text //! target/ //! metadata/run/freshness/v1_{N}.parquet ← append-only, one row per source per check //! ``` use std::path::{Path, PathBuf}; use std::sync::Arc; use arrow::datatypes::{DataType, Field, TimeUnit}; use dbt_c...
0a6c72fd8414dda91280cd51936d432e5bd849108d3ce189ed047e1a69edfed3
Rust
12,187
315
use core::fmt; use std::num::NonZero; use dbt_adapter_core::{AdapterType, quote_char}; use super::is_keyword_ignore_ascii_case; use super::tokenizer::QuotingStyle; /// An identifier and its provenance (from quoted or an plain identifier in the input source). /// /// The name [Ident::Unquoted] means that the identifi...
ae8e6c0d71846a23f68c2b018af922361d288620a0721ef51e8861c8054f9ecf
Rust
12,227
347
use std::{collections::BTreeMap, env}; use dbt_common::io_args::EvalArgs; use dbt_common::io_args::LogLevel; use dbt_common::io_args::ReplayMode; use dbt_common::warn_error_options::WarnErrorOptions; use itertools::Itertools; use minijinja::Value; /// Invocation args is the dictionary of arguments passed into the jin...
9b94e1a7fa3ca88699f2ec3bd8cbad2a829e3ce3894c1d8ee60a7fe17b62b002
Rust
12,256
359
#![cfg(feature = "unstable_machinery")] use minijinja::compiler::codegen::CodeGenerationProfile; use minijinja::constants::{CURRENT_PATH, CURRENT_SPAN}; use minijinja::machinery::{CodeGenerator, Instruction, Instructions, Span, Vm}; use minijinja::value::Value; use minijinja::{AutoEscape, Environment, Error}; use std::...
08be976e07216825c7c5bcfe76bd045beb5d6b2033b810ee0f5fab4a7790d091
Rust
12,307
329
use dbt_common::ErrorCode; use dbt_common::tracing::dbt_emit::emit_warn_log_message; use dbt_common::{AdapterError, AdapterErrorKind}; use dbt_schemas::schemas::common::{Constraint, ConstraintSupport, ConstraintType}; use dbt_schemas::schemas::properties::ModelConstraint; use dbt_adapter_core::AdapterType; /// Emits ...
f838333a593212edbb86e989e47a04d7563780de7e3190a93b996e9c48305f1f
Rust
12,320
355
//! SLT-style declarative harness for cross-phase Jinja context comparisons. //! //! A `.slt` file describes how individual context keys (or sub-paths like //! `target.name`, `flags.FULL_REFRESH`) appear in each phase's typed context. //! The harness loads each phase's fixture (a `Serialize`-backed typed ctx //! constr...
3afabe8ce168bf0322e8225f72cbf9e17acaebc28f545875327a0b60471f0fc4
Rust
12,328
261
//! Module for the parse config object to be used during parsing use indexmap::IndexMap; use std::{ collections::{BTreeMap, HashSet}, path::PathBuf, rc::Rc, sync::Arc, }; use dbt_jinja_ctx::{LazyModelWrapper, ModelContextMap}; use dbt_common::{ CodeLocationWithFile, ErrorCode, fs_err, tracing::db...
b87e7ab566673bf0814ea37587a03efb6ae940bfebcff769379b60e33d9c130b
Rust
12,395
280
use minijinja::arg_utils::ArgsIter; use minijinja::value::Value; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use crate::response::{AdapterResponse, ResultObject}; use crate::value::none_value; use dbt_agate::AgateTable; use dbt_common::tracing::span_info::find_and_update_span_attrs; use dbt_telemetry::...
01723f0151bff1c2d5916101464d83c0e19407f749c07a7a9901abfee1c9ca78
Rust
12,440
293
//! RAD-input quantification must report measured strand-compatibility counts in //! `lib_format_counts.json` (#1130), not the historical hardcoded `1.0`. //! //! This is what makes the full `--deterministic` flow correct: its phase 2 is a //! RAD requant into the final output directory, whose `write_outputs` rewrites ...
3c0a600b2d02b58be93a142a57147aa1461da6b2a1266ef344aa34eb382912df
Rust
12,468
364
//! Python AST parsing and literal evaluation for Python models //! //! This module provides utilities for parsing Python model files and extracting //! dbt function calls (ref, source, config) using AST analysis. use dbt_common::{ErrorCode, FsResult, err}; use ruff_python_ast::{self as ast, Expr, ModModule, Stmt}; us...
85a6690549b0ce3a228cdf92f117afe28ea74fa971a43b287b4f1ada37a07795
Rust
12,480
332
mod steps; mod add_package; mod context; pub(crate) mod git_client; mod hub_client; mod network_client; mod notices; mod package_checksum; mod package_installer; pub mod package_listing; mod package_resolver; pub mod private_package; pub mod semver; mod tarball_client; pub mod types; pub mod utils; use dbt_common::c...
b9b72b0aa127bffae999c89b9ccaf4678255e33d6f9e9cac2af96ec52466ee8c
Rust
12,482
385
use std::fmt; use std::sync::atomic::{AtomicU32, Ordering}; /// General-case semaphore implementation. /// /// Typical Dijkstra Semaphore algorithm over atomics, wait and notify functions. /// /// The `atomic-wait` crate by Mara Bos is used as it provides the atomic wait and wake /// functionality that exists in C++20...
74b701dafb98b4975a5f6f58e1df021b73c619f6a97e31e0eaa2edd37cbc792f
Rust
12,492
364
use dbt_common::{ErrorCode, FsResult, fs_err}; use dbt_schemas::schemas::manifest::metric::MetricTimeWindow; use dbt_schemas::schemas::properties::MetricsProperties; use regex::Regex; /// Validates all aspects of a metric according to the rules ported from Python dbt. /// This is a unified validation function that che...
cc171abc51878c13e41d516ca673801094cf85d56549aaa36b27e994b5dd8570
Rust
12,543
332
use chrono::{DateTime, LocalResult, NaiveDateTime, TimeZone}; use chrono_tz::{Tz, TZ_VARIANTS}; use minijinja::{Error, ErrorKind, Value}; use std::collections::{BTreeMap, HashMap}; use std::fmt; use std::sync::{Arc, OnceLock}; /// A Python-like "pytz" timezone object that wraps a `chrono_tz::Tz`. #[derive(Debug, Clone...
2946cb39a34b566a219e190643b18f06568acc4b0c466cb65f400abfecd4d2f6
Rust
12,586
384
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/tblproperties.py use crate::errors::AdapterResult; use crate::relation::config_v2::{ ComponentConfig, ComponentConfigLoader, SimpleComponentConfigImpl, impl_loader, }; use crate::relation::databricks::config::{ ...
2aba15051df991a72a2f34a248c8e06e8a61d5fedbb237b7208c56cfe556f020
Rust
12,589
398
//! Background writer task for persisting recorded events to disk. //! //! The writer receives events via MPSC channel and writes them to a //! compressed NDJSON file with an index for efficient per-node access. use std::io::Write; use std::path::PathBuf; use std::{collections::HashMap, io}; use dbt_common::cancellat...
e89b3694d56f71d1e1c4e201cd8dc1661306e1a2045a04a4f0d32ed1cb90cae7
Rust
12,630
268
//! Per-render context structs for the resolve (parse) phase. //! //! Unlike [`crate::core::ResolveCore`] which describes the *env globals* set //! once at parse-env construction, the structs in this module describe the //! *per-render* context — what gets passed to `render_named_str<S: Serialize>` //! at every templat...
fd730d65a19a7f527243bcc862830314ef2b56785b85a87050624ee2c474655d
Rust
12,633
321
use std::sync::{Arc, Mutex}; use base64::Engine as _; use base64::engine::general_purpose::URL_SAFE_NO_PAD; use dbt_common::cancellation::CancellationToken; use dbt_common::{ErrorCode, FsResult, fs_err}; use dbt_platform_auth::resolver::{INTERACTIVE_TIMEOUT, OAUTH_SCOPES, OAuthInteractiveResolver}; use dbt_platform_au...
0ca3f905fbedf88b6f56c9a935388eb4cab45a6c42a288dfa0c783db0c48a831
Rust
12,744
357
use dbt_base::Cancellable; use minijinja::{Error as MinijinjaError, ErrorKind as MinijinjaErrorKind}; use std::future::Future; use std::io::{self}; use std::pin::Pin; use std::sync::Arc; use std::{fmt, panic}; use super::{ErrorCode, types::FsError}; pub type AdapterResult<T> = Result<T, AdapterError>; /// A pinned F...
710f2da4001508baf47289b84a5534e343c500f7d95aa62c0371324236bda7e5
Rust
12,750
361
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/column_mask.py use dbt_schemas::schemas::{DbtModel, InternalDbtNodeAttributes, dbt_column::ColumnMask}; use indexmap::IndexMap; use minijinja::Value; use serde::Serialize; use crate::errors::AdapterResult; use crate::r...
5b08e5abbbefcd3513e5f7b2be26e346bd0ede5910b7e3cc048aab2cbd515d87
Rust
12,792
414
// `ok!` and `some!` are less bloaty alternatives to the standard library's try operator (`?`). // Since we do not need type conversions in this crate we can fall back to much easier match // patterns that compile faster and produce less bloaty code. macro_rules! ok { ($expr:expr) => { match $expr { ...
b3402a87683998a179e6a96570280d96a04e0a8505c7d85e2b3f270ab512715e
Rust
12,795
279
//! Module for the parse config object to be used during parsing use std::{ collections::{BTreeMap, HashSet}, rc::Rc, slice, sync::Arc, }; use dbt_common::dashmap::DashMap; use dbt_common::{ CodeLocationWithFile, ErrorCode, fs_err, tracing::dbt_emit::emit_warn_log_from_fs_error, }; use minijinja::...
93b3503546510f1c8c8fe4b4a4bd799b0427e4b735276a342eb34c417263a545
Rust
12,845
333
use std::borrow::Cow; use std::collections::BTreeMap; use std::path::PathBuf; use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use adbc_record_replay::{RecordConnection, RecordingContext, ReplayConnection}; use arrow_array::RecordBatch; use dbt_adapter_core::AdapterType; use dbt_adbc::{Backend, Connec...
acf96f2e8be741d4c3cc16fb0bab2e32f84359e3bd15b5b0795e31efb5824a73
Rust
12,875
342
//! Cubic spline interpolation — a faithful port of the vendored `tk::spline` //! (Tino Kluge) used by salmon's `SimplePosBias`. //! //! # What a spline is for here //! //! The positional bias model measures fragment starts in a handful of coarse //! bins along each transcript. To *use* that model we need a smooth valu...
b0b1ff48b8135831dbec0236ea90cb014bb628f0f561639ef141a46114b30cc9
Rust
12,906
327
use dbt_adapter::adapter::AdapterFactory; use dbt_adapter::sql_types::TypeOpsFactory; use dbt_clap_core::{Cli, Command, CoreCommand}; use dbt_common::{FsResult, io_args::EvalArgs}; use dbt_compilation::config::CompilationConfig; use dbt_compilation::core::DbtLoadedProject; use dbt_jinja_utils::JinjaFactory; use dbt_jin...
0a5fc648a5790e1b46398fb7ff509c975cdde7b62fde8a3e7d1bf10950d82abd
Rust
12,917
359
use arrow::array::{ArrayRef, StringBuilder}; use arrow::datatypes::{DataType, Field, Schema}; use arrow::record_batch::RecordBatch; use dbt_agate::AgateTable; use minijinja::{Error, ErrorKind, Value}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::sync::Arc; /// Represents a column defini...
7f414afda39c13863c930be6aaae4ca42c44b4927673d80d32885c8c908b40af
Rust
13,119
348
use std::env; #[cfg(target_os = "windows")] use std::{ fs::File, io::Write, process::{Command, Stdio}, }; #[cfg(target_os = "windows")] use uuid::Uuid; use dbt_common::FsResult; #[cfg(target_os = "windows")] use dbt_common::constants::DBT_CDN_URL; use dbt_common::{ErrorCode, err}; use dbt_dist::DistInfo;...
5b0602ffcaf54c8312c09f5d36f8241987dd2542cc23522644c4893ee230641d
Rust
13,168
355
use crate::adapter::adapter_impl::*; use crate::connection::AdapterConnectionFactory; use crate::metadata::{ CatalogAndSchema, MetadataAdapter, MetadataFreshness, RELATION_CACHE_OP_ID, RelationSchemaPair, RelationVec, create_schemas_if_not_exists, run_schema_cache_map_reduce, with_relation_list_item_span, }...
11e0c8d67d856d236cb21e6d3c8ef6d585c7d2bf085ba8744f08a99f74a7ecdd
Rust
13,193
292
//! Per-render context structs for the compile (render) phase. //! //! Compile shares the parse `JinjaEnv` (mutated in place by //! `configure_compile_and_run_jinja_environment` — only adapter + //! `undefined_behavior` change, no globals re-registered), so the structs in //! this module describe *per-render* contexts ...
ef0099127dc2202d9c427045f3e9123f3f039fcca2c7d29c4f82c342639b92c7
Rust
13,201
586
use std::collections::HashSet; use dbt_adapter_core::{AdapterType, quote_char}; use once_cell::sync::Lazy; pub fn format_ident(id: &str, adapter: AdapterType) -> String { if !need_quotes(id, adapter) { return id.to_string(); } // Fabric/T-SQL delimits identifiers with brackets, not a symmetric quo...
dad9314aa773b3c4470af8e4c56301d22b8e953c8a1d16b9e689db8ac3ce9d6f
Rust
13,342
403
use std::{path::PathBuf, sync::Arc}; use dbt_yaml::JsonSchema; use serde::{Deserialize, Serialize}; use crate::utils; use super::preprocessor_location; type CodeLocation = dbt_frontend_common::error::CodeLocation; /// Represents a concrete location in some source file. #[derive(Clone, Default, Debug, Eq, PartialEq...
d2e5284285fefd8a15e18a791b4c4c9f69e5dfcc58de709685d11b76ae0744d6
Rust
13,344
433
use std::borrow::Cow; use std::collections::{BTreeMap, HashSet}; use std::fmt; use std::path::PathBuf; use std::sync::Arc; use crate::environment::Environment; use crate::error::{Error, ErrorKind}; use crate::machinery::Span; use crate::value::{Value, ValueIter}; use crate::vm::loop_object::Loop; #[cfg(feature = "mac...
f38adf0236346acf536b37031d515f2162bfef72fe8507b3649010c0cbaa649b
Rust
13,355
344
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/incremental.py use crate::AdapterType; use crate::relation::config_v2::ComponentConfigChange; use crate::relation::config_v2::{ComponentConfigLoader, RelationConfigLoader}; use crate::relation::databricks::config::{Data...
8a4c32dd469505b77eb0bece04e57ced75649c7d77b7de7f3c0fc635ec709f50
Rust
13,425
297
//! Regression test for the alignment-mode analog of issue #1025: on a stranded //! library, `num_mapped` must count only fragments with a surviving strand- //! compatible placement, so the mass-conservation invariant `num_mapped == Σ //! counts` holds (and `percent_mapped` is not inflated). Before the fix, //! alignme...
48a3ea7705284a82ca22f4d91fb63176e9db7fa6229e4dd3f4e1fcdbf97b4368
Rust
13,438
341
use std::collections::HashMap; use std::{collections::BTreeMap, sync::Arc}; use crate::resolve::resolve_utils::{err_resource_name_has_spaces, validate_node_adapter}; use dbt_adapter_core::AdapterType; use dbt_common::cancellation::CancellationToken; use dbt_common::path::{DbtPath, node_name_from_path}; use dbt_common...
fb3a2c2a1abba90bcc0d051f1b9099eff8b11c9da062decd1effd227dacb2eab
Rust
13,539
386
use std::fmt::Debug; use std::sync::Arc; use std::{collections::BTreeMap, rc::Rc}; use minijinja::{ Error as MinijinjaError, ErrorKind as MinijinjaErrorKind, State, arg_utils::ArgParser, listener::RenderingEventListener, value::{Object, ObjectRepr, Value}, }; use crate::invocation_args::InvocationArgs...
d4c936af2b9dbd6be924d733b782fba958f7fd7eb9f79c5c41fb9fd399398e6b
Rust
13,750
357
use dbt_adapter::{enforce_adapter_gating, experimental_adapters_allowed}; use dbt_common::tracing::dbt_emit::{emit_info_progress_message, emit_warn_log_message}; use dbt_telemetry::ProgressMessage; use dbt_common::stdfs::canonicalize; use dbt_common::warn_error_options::WarnErrorOptions; use dbt_common::{ErrorCode, Fs...
796ee27006444ed32511ac8137f2ad7fb0631bb5c95025321bc3eb4846e7f922
Rust
13,789
435
use std::ops::{Deref, DerefMut}; use serde::de::value::{MapDeserializer, SeqDeserializer}; use serde::de::{ self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, IntoDeserializer, MapAccess, SeqAccess, Unexpected, VariantAccess, Visitor, }; use serde::forward_to_deserialize_any; use crate::value::{Arg...