sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
d7a7382fb26523dfd096161b23204f852776ea85c4073eec054fcee0d10f3e11
Rust
13,817
466
use std::{ error::Error, fmt, sync::{ Arc, LazyLock, Weak, atomic::{AtomicBool, AtomicU64, Ordering}, }, }; static NEVER_CANCELS_CST: LazyLock<CancellationTokenSource> = LazyLock::new(CancellationTokenSource::new); pub struct CancelledError; /// Turns any error type `E` into a can...
5179dd05af14767caa4c26c28ef496669e5c30b8226497baee3049f8e415e7ee
Rust
13,820
363
use std::fmt::Debug; use dbt_frontend_common::Dialect; use dbt_sql_utils::{is_empty_or_comment_only, sql_split_statements}; use crate::AdapterType; /// Trait for SQL statement splitting functionality pub trait StmtSplitter: Send + Sync + Debug { /// Split a SQL string into individual statements /// /// T...
6a07db81015314f4213fff122da8b5d0394efee5a4e7752bad234b6bebee07b0
Rust
13,839
391
//! Time Machine: Cross-Version Record/Replay System //! //! This module provides infrastructure for recording and replaying adapter-level //! behavior, enabling backward compatibility testing across Fusion versions. //! //! # Architecture //! //! The system captures events at two levels: //! //! 1. `Adapter` (sync): J...
5fd19be11a4e5c03872446f9b788f9f6d4f6cf8dec25c3bf91b132f81a7ebaec
Rust
13,850
328
//! <div align=center> //! <img src="https://github.com/mitsuhiko/minijinja/raw/main/artwork/logo.png" alt="" width=320> //! <p><strong>MiniJinja: a powerful template engine for Rust with minimal dependencies</strong></p> //! </div> //! //! MiniJinja is a powerful but minimal dependency template engine for Rust whi...
bbf0432280d45748043a4bf30b1a13a0fb91c71054a7ffd80f60d8bd5ce2a1aa
Rust
13,908
422
//! Data types define how data should be imported during the creation of a //! :class:`.Table`. //! //! If column types are not explicitly specified when a :class:`.Table` is created, //! agate will attempt to guess them. The :class:`.TypeTester` class can be used to //! control how types are guessed. //! //! https://g...
f98b2f70c4461f62cf9f83122151f31d373c63c715d4f847843561edac82483b
Rust
13,922
365
use std::collections::HashMap; use std::{collections::BTreeMap, sync::Arc}; use crate::resolve::resolve_utils::err_resource_name_has_spaces; use dbt_adapter_core::AdapterType; use dbt_common::cancellation::CancellationToken; use dbt_common::path::DbtPath; use dbt_common::tracing::dbt_emit::emit_warn_log_from_fs_error...
83f256fc838c28e3884c3ba95d2878281ce1e7d7597a6641970f206158e3501f
Rust
13,932
380
//! This crate adds a convenient auto reloader for MiniJinja. //! //! The [`AutoReloader`] is an utility type that can be passed around or placed //! in a global variable using something like //! [`once_cell`](https://docs.rs/once_cell/latest/once_cell/). It accepts a //! closure which is used to create an environment...
b275af458ae9e98884f90381d9c51a514b8369a4869eb87f1b8182ef2bbafdf6
Rust
13,937
338
//! DuckDB v2-catalog `ATTACH` statement composition. //! //! Extracted from the generic `AdbcEngine` (`engine/adbc.rs`) so this //! DuckDB-specific logic is not hardcoded in the cross-adapter engine. //! //! FIXME: as the number of catalog types and attach options grows, audit whether //! the attach composition logic ...
d2228187ff079b2e2c5096a393a80f63fef9d05c10aba563affda896052b84c6
Rust
14,008
524
#[cfg(feature = "internal_debug")] use std::fmt; use crate::compiler::codegen::TypeConstraint; use crate::compiler::tokens::Span; use crate::layout::JinjaLayoutEventKind; use crate::output::CaptureMode; use crate::value::Value; /// This loop has the loop var. pub const LOOP_FLAG_WITH_LOOP_VAR: u8 = 1; /// This loop ...
6eed0fe91038b573dada7fa7a9c3c40fe6aac1be10117a461cc1c97b5fa2eb1b
Rust
14,013
371
//! Tests for the parse-safe views. Like the schema tests, these need no fixtures: the //! views are a pure function of [`VIEWS`] and [`INFO_SCHEMA`]. use std::collections::HashSet; use super::parse_safe::{BASE_SCHEMA, VIEWS, base_tables}; use super::schema::spec_for; use super::spec::{Ns, Src}; use crate::parquet::s...
aae51a2d08069083399018b0daee74c0e0a9c0034e3d685a4ae4e7e0a457d630
Rust
14,016
398
use std::collections::BTreeMap; use std::sync::Arc; use dbt_adapter::relation::RelationObject; use dbt_adapter_core::AdapterType; use dbt_jinja_utils::mock_object::MockJinjaObject; use dbt_schemas::dbt_types::RelationType; use minijinja::Value; use crate::macro_test_harness::{MacroTestHarness, assert_executed_contain...
6c2e02c22122586ca68afa8cb6f803b73c9b284f7af3dfa7679f1480dfb4ddb5
Rust
14,024
408
//! Groups 4 and 5 of the pre-2.6.0 readiness sweep: `meta_info.json` fields and //! log text that asserted something the run did not do, and errors that arrived //! too late or named the wrong flag. All machine-read or user-facing, all on //! default paths. use std::path::{Path, PathBuf}; use std::process::Command; ...
d8ca2765b9836b81f6deddad45b8b786f0ecc15c48fb550b0edcfcbb65fed5b0
Rust
14,049
447
use sha2::{Digest, Sha256}; use tokio::task::JoinHandle; use tokio::time::sleep; use uuid::Uuid; use crate::path::DbtPath; use crate::stdfs::{create_dir_all, read_to_string, remove_file}; use crate::time::{current_time_micros, time_micros}; use crate::tracing::dbt_emit::emit_info_log_message; use crate::{ErrorCode, Fs...
216053942ddfa6639bf972e8566185fc3b463ede4830307132feed2bc71ab787
Rust
14,127
454
//! Reads `pyproject.toml` at the cargo workspace root — source of truth for the //! wheel name and PEP 621 metadata that `pack` stamps into each wheel. use crate::utils::cargo_workspace_root; use anyhow::{Context, Result, anyhow}; use std::fs; use std::path::{Path, PathBuf}; use toml_edit::{DocumentMut, Item}; #[de...
d9bb7fc928c87baec354a0eb85862904e27dc3a1e585c0fd5e809d2b8d4a29e7
Rust
14,187
404
use dbt_common::serde_utils::convert_yml_to_value_map; use dbt_common::{AdapterError, AdapterErrorKind, AdapterResult}; use dbt_schemas::schemas::project::ModelConfig; use dbt_schemas::schemas::{CommonAttributes, InternalDbtNodeWrapper}; use indexmap::IndexMap; use minijinja::Value; use minijinja::value::mutable_vec::M...
86dd2c152cd319617e9f4eff8ee1ccc77e539daa8d269241cc9aa5b359104e0a
Rust
14,220
366
use std::convert::TryFrom; use minijinja::value::{Kwargs, Value, ValueKind}; use minijinja::{Error, ErrorKind, State}; use serde::de::value::SeqDeserializer; use serde::Deserialize; use time::format_description::well_known::iso8601::Iso8601; use time::{format_description, Date, OffsetDateTime, PrimitiveDateTime}; fn ...
0c2b4b88c732fca5b12a6d3dfda28d9445186a75dc01b69319731b77ce794951
Rust
14,248
316
//! This module contains the listener trait and its implementations. //! use std::fmt::Write; use std::path::Path; use crate::compiler::tokens::Token; use crate::layout::JinjaLayoutEventKind; use crate::output_tracker::OutputTracker; use crate::value::Value; use crate::{machinery::Span, CodeLocation}; /// A listen...
64e9ccdd5f05a0f36c6f95be5eeb151d0fbe99811330c8dfe5af05cc4fa8b1e5
Rust
14,300
334
use crate::args::ResolveArgs; use crate::dbt_project_config::{ ProjectConfigResolver, RootProjectConfigs, disallow_plus_prefix_from_flags, init_project_config, }; use crate::resolve::resolve_utils::build_unrendered_config; use crate::resolve::resolve_utils::extract_config_map; use crate::utils::{ extract_resour...
9a9856086ef74cd685463263d889eeac562efe37530567e6a286e971a36f522f
Rust
14,384
452
use std::borrow::Cow; use std::collections::BTreeMap; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::sync::Mutex; use std::{fs, io}; use anyhow::{bail, Context, Error}; use clap::ArgMatches; use minijinja::machinery::{ get_compiled_template, parse, tokenize, Instructions, WhitespaceConfig, };...
e304bfe9eefd893e4d69a6301596b0c3d0e4e929efb9b29c1b7c1dc0bb03ffab
Rust
14,400
353
//! Top-down prediction for volatile-node layers, mirroring //! `pyhgf/updates/vectorised/volatile/prediction.py`. use super::guarded_volatility; use crate::math::{with_coupling, CouplingFn}; use crate::vectorised::layer::{LayerParams, LayerState}; use crate::vectorised::mat::{Float, Matrix}; use ndarray::Array1; ///...
a1ed57a62a10b0d1d21864fcba054c3d518bbee11b3d576d902f471802fa279a
Rust
14,449
340
//! Positional fragment bias (`SimplePosBias`) — a port of salmon's //! `src/model/SimplePosBias.cpp`. //! //! # The effect being modelled //! //! Fragments are not drawn uniformly along a transcript. Degraded RNA is //! preferentially sequenced near its 3' end; some protocols pile up at the 5' //! end; random priming ...
ec47f051fd5a22cb895030bc85de90f78c38e27e17df129639e794609ee22d6b
Rust
14,643
420
use std::rc::Rc; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::Arc; use minijinja::listener::RenderingEventListener; use minijinja::value::mutable_map::MutableMap; #[allow(unused)] use minijinja::value::Value; use minijinja::value::{from_args, Kwargs, Object, ObjectRepr, Rest, ValueKind}; ...
47e7bad9bb8c4d68f103efa2aa4a79c1adb3f38e46529cc612d274238b49a50a
Rust
14,689
348
use crate::AdapterType; use crate::errors::{AdapterError, AdapterErrorKind, AdapterResult}; use crate::relation::config_v2::{ ComponentConfig, ComponentConfigChange, RelationConfig, RequiresFullRefreshFn, }; use crate::relation::databricks::config::components; use crate::relation::databricks::typed_constraint::Type...
271a6de23d4f5eec272d5209cb02057c4a69ccb69975d3ddc9891891ff6a49c0
Rust
14,766
409
use dbt_common::{AdapterError, AdapterResult}; use dbt_schemas::schemas::InternalDbtNodeAttributes; use minijinja::Value; use super::snowflake_attr; use crate::relation::snowflake::config::{ SnowflakeDescribeResults, get_string_by_name_from_record_batch, }; use crate::{ relation::config_v2::{ Component...
d0aebb26da2f1967bb9bff5d14d0df2a4902706067029e0055b0f845c775b8cb
Rust
14,946
448
use core::fmt; #[derive(Debug)] pub enum Token<'source> { LParen, RParen, /// Left bracket: [. LBracket, /// Right bracket: ]. RBracket, /// Left angled bracket: <. LAngle, /// Right angled bracket: >. RAngle, Comma, Colon, /// Word includes keywords, identifiers, qu...
bf510bb30683b0e3448a546b81642c5bb7bc51ae99874a72b28a7ce3df229a3f
Rust
15,006
441
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/streaming_table.py use crate::AdapterType; use crate::relation::config_v2::ComponentConfigChange; use crate::relation::config_v2::{ComponentConfigLoader, RelationConfigLoader}; use crate::relation::databricks::config::{...
84a606ec135f6470f4e1c720b96db8bedbedfefd8cff5d94b3d768cb9ec6534d
Rust
15,068
397
//! Prediction errors and the volatility-level posterior updates for //! volatile-node layers, mirroring //! `pyhgf/updates/vectorised/volatile/prediction_error.py` (which, like here, //! hosts the per-update-type volatility posteriors and the combined driver). use super::MIN_VOLATILITY; use crate::math::{lambert_w0, ...
82b1e94e2bc175fe7172a05c5029d8a4d96bd4a71f3ff84232ae2f012aa43443
Rust
15,073
434
use crate::AdapterType; use crate::errors::{AdapterError, AdapterErrorKind, AdapterResult}; use crate::relation::bigquery::config::components; use crate::relation::config_v2::ComponentConfigChange; use crate::relation::config_v2::{ ComponentConfig, ComponentConfigLoader, RelationConfig, RelationConfigLoader, }; use...
95c8c5530624abfa589485aa75db2f53367917facc88c51c8ad67f6dfdee661f
Rust
15,126
474
use std::collections::HashMap; use std::io::Read; use std::sync::{Arc, Mutex, RwLock}; use std::time::{Duration, Instant}; use once_cell::sync::Lazy; use serde::Deserialize; use serde_json::Value; use thiserror::Error; use ureq::http::header::{HeaderName, HeaderValue}; use ureq::{Agent, Body, Error as UreqError, http}...
0f18d897006e90c8b4abd737c484a79fe3931a1ad8e2e897a55c73f94a423478
Rust
15,209
442
use std::borrow::Cow; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::{fmt, iter}; use crate::compiler::tokens::Span; use crate::constants::{DBT_INTERNAL_PACKAGES_DIR_NAME, DBT_PACKAGES_DIR_NAME}; /// Represents template errors. /// /// If debug mode is enabled a template error contains additional debug ...
c3690c07bb9ee84b10e977379a945a9fd920f975a338b6daa8d4254d7cdb1ff4
Rust
15,214
494
use serde::{Deserialize, Serialize}; use strum::{AsRefStr, EnumIter, EnumMessage, EnumString}; // TODO: these models should live in dbt-schemas crate. It currently lives in dbt-common because // EvalArgs is defined here and dbt-common cannot depend on dbt-schemas without creating a cycle. /// Legacy dbt-core event na...
c9a3d439546ebb7113d9f85be0e889d02342c8f48792de788fccc0c2c5217c69
Rust
15,305
419
use std::{ borrow::Cow, collections::BTreeMap, path::{Path, PathBuf}, }; use dbt_schemas::schemas::{packages::LocalPackage, project::DbtProjectNameOnly}; use normalize_path::NormalizePath; use dbt_common::{ErrorCode, FsResult, constants::DBT_PROJECT_YML, fs_err, tokiofs}; const DEFAULT_DEPS_MAX_CONCURREN...
20ebe4c7038c94d5c6e59c634d10d32ad8d5b105bc5138e787aa0f6763f4e4cc
Rust
15,342
481
use minijinja::{context, Environment}; use minijinja_contrib::filters::pluralize; use similar_asserts::assert_eq; #[ignore = "zhong is refactoring vm https://github.com/dbt-labs/fs/issues/4808"] #[test] fn test_pluralize() { let mut env = Environment::new(); env.add_filter("pluralize", pluralize); for (nu...
fd4591b0370c2aa8b98c843c9845314832d803854c5f35b7b5dea22a7b46a9a7
Rust
15,344
380
//! Read seed files, without a DataFusion `SessionContext`. //! //! JSON and physical-types parquet entrypoints block the caller; run them on a blocking //! pool when inside async code. The view-promoted parquet entrypoint is async (`tokio`). use arrow::array::RecordBatch; use arrow::compute::CastOptions; use arrow_sc...
79a549b12f1a8778eefdd44f5663754e184d22cf049517ff591498ed1619f147
Rust
15,373
398
//! The gated build/refresh-warehouse component for interactive tables. //! //! Also hosts `validate_not_transient` and `should_warn_initialization_warehouse_inert`: //! `transient` and `snowflake_initialization_warehouse` are shared, unforked components that //! dynamic tables also use, and this is the only new compon...
448aa8586eb408c19a5f49cabde336e0aae70f99b9911e6d9bef4340a75a5d18
Rust
15,402
438
use std::char::decode_utf16; use std::collections::BTreeMap; use std::fmt; use std::iter::{once, repeat}; use std::str::Chars; use crate::error::{Error, ErrorKind}; use crate::value::{StringType, Value, ValueIter, ValueKind, ValueRepr}; use crate::Output; /// internal marker to seal up some trait methods pub struct S...
d49f6deebea847405b7095bb2824d0b646ae0ed7b0bc9d96de497e4f4c384d6f
Rust
15,412
441
//! End-to-end MEM collection against a real piscem index built by salmon-index. //! //! Builds a single-transcript index, then maps a forward substring and its //! reverse complement back to it, asserting we recover a high-coverage chain on //! the correct transcript and orientation at the expected position. use pisc...
5d85bfde8449912f5147b0b267eda18cacf36729ec2a990e83d7960b5df2a808
Rust
15,430
469
use adbc_core::error::{Error as AdbcError, Result as AdbcResult, Status as AdbcStatus}; use adbc_core::options::{OptionStatement, OptionValue}; use arrow::array::{RecordBatch, RecordBatchReader}; use arrow::record_batch::RecordBatchIterator; use arrow_schema::{ArrowError, Schema}; use dbt_adbc::{Connection, Statement};...
85866355ea9e9c4a1d171b6349debc7073ce813443ad5e64b5e40118c222ea24
Rust
15,436
397
//! MEM collection over piscem k-mer hits. //! //! # Where mapping starts //! //! This is the first stage: turn "these k-mers of the read were found in the //! index" into "these are the candidate placements worth considering". The index //! answers per k-mer, and answers in terms of the de Bruijn graph's unitigs, so /...
fff3de1fa814493260ce31055d6aa7a815ffa8e35531d7b6740c761d94b42ce4
Rust
15,669
429
//! End-to-end `dbt deps` tests for agent-skill installation. //! //! These drive the real `get_or_install_packages` entry point against `local:` //! packages, so they exercise lock computation, package install and the skill //! pass together without touching the network. They also stand as a regression //! test for th...
8ca0a008985ca9f4529213c10a5922689826d7c8c9b36575e1145e0d53fba3cf
Rust
15,736
442
use std::collections::BTreeMap; use std::sync::Arc; use dbt_adapter::relation::RelationObject; use dbt_adapter_core::AdapterType; use dbt_jinja_utils::mock_object::MockJinjaObject; use dbt_schemas::dbt_types::RelationType; use minijinja::Value; use crate::macro_test_harness::{MacroTestHarness, assert_executed_contain...
a16e55697095b9e45d25077fe62f24f0adcafc2e5b634ec985eae84a916594f3
Rust
15,851
479
use std::path::PathBuf; use std::{collections::HashMap, str::FromStr}; use dbt_common::{ErrorCode, FsError, FsResult, err, fs_err}; use dbt_schemas::schemas::packages::{ GitPackage, HubPackage, PackageVersion, PrivatePackage, PrivatePackageProvider, TarballPackage, }; use dbt_yaml::Value as YmlValue; use super::s...
f2987e96b52181976fdfc2eeec3b150824c471cbeccabb4540d1e281d9449f96
Rust
15,966
505
//! Event recorder with MPSC channel for non-blocking event emission. //! //! The recorder provides a unified interface for emitting events from both //! synchronous (Adapter) and asynchronous (MetadataAdapter) contexts. use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering}; use std::time::Instant; use ...
50fd83f5d64426a100c10c7e24531d95368ff7122c7334dbc843a549b59137dd
Rust
15,986
397
//! https://github.com/dbt-labs/dbt-adapters/blob/main/dbt-snowflake/src/dbt/adapters/snowflake/relation_configs/dynamic_table.py use crate::AdapterType; use crate::relation::config_v2::ComponentConfigChange; use crate::relation::config_v2::{ComponentConfigLoader, RelationConfigLoader}; use crate::relation::snowflake:...
265f430d2d5b829d2d00537766bbf06385131f61ec6a189c1ae815727d71acce
Rust
16,186
557
use crate::{AuthError, Credential}; use dbt_schemas::schemas::DbtCloudConfig; use dbt_schemas::schemas::project::ProjectDbtCloudConfig; use serde::Deserialize; use std::io::ErrorKind; use std::path::PathBuf; /// Resolves credentials from `~/.dbt/dbt_cloud.yml`. /// /// Resolution order for the active project and host ...
0da4817558cfdd9cfe79881d4e6667e86d2670ebe2b51e4ee080d6bb9419e763
Rust
16,187
522
#![cfg(feature = "unstable_machinery")] use std::cell::RefCell; use std::collections::BTreeMap; use std::path::PathBuf; use std::rc::Rc; use std::sync::Arc; use minijinja::compiler::codegen::CodeGenerationProfile; use minijinja::funcsign_parser; use minijinja::load_builtins_with_namespace; use minijinja::machinery::S...
7c5ac9ce94bea4c691e14a00cc743db48375f94fc5a1f5117d2cd3317f345393
Rust
16,282
428
use once_cell::sync::Lazy; use regex::Regex; static TIMESTAMP_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}").unwrap()); // Same as `TIMESTAMP_REGEX`, but for finding timestamps embedded in larger tokens // (e.g. when surrounded by quotes/parens). static TIMESTAMP_FIND_REGEX: ...
6a3e76f7f35a477853d25b236a21b0c66af2d961e00352fd25ef541b0463e54a
Rust
16,336
472
use std::rc::Rc; use std::sync::Arc; use std::{fmt, io}; use minijinja::arg_utils::ArgsIter; use minijinja::listener::RenderingEventListener; use minijinja::value::{Enumerator, Object, ObjectRepr}; use minijinja::{Error, ErrorKind, State, Value}; use crate::columns::{ColumnNamesAsTuple, ColumnTypesAsTuple}; use crate...
136beaf2c892c676f69b3333e2e443ac46e4f46532073e341182ada1174c61c3
Rust
16,514
511
//! Concurrent package installation: one trait impl per unpinned package kind. use std::path::Path; use dbt_common::tracing::dbt_emit::emit_info_log_message; use dbt_common::tracing::span_info::{SpanStatusRecorder as _, update_span_attrs}; use dbt_common::{ErrorCode, FsResult, create_info_span, fs_err, stdfs, tokiofs...
02e43429f6444e8b2809a62d85b50166f9ff83674257f0686769ef51c74efeae
Rust
16,602
462
//! Conversion between minijinja::Value and serde_json::Value for time-machine recordings. use dbt_adapter_core::AdapterType; use dbt_schemas::dbt_types::RelationType; use dbt_schemas::schemas::common::ResolvedQuoting; use super::serializable::{deserialize_object, serialize_object}; // ==============================...
cf925a64c62e7e7d49bcfc009f9718825d9d73abf75a7cc68f5afd2a67abc215
Rust
16,653
402
use std::{ collections::BTreeMap, path::{Path, PathBuf}, sync::{Arc, Mutex, atomic::AtomicBool}, }; use crate::utils::NoOpConfig; use dbt_adapter_core::AdapterType; use dbt_common::{CodeLocationWithFile, ErrorCode, FsResult, fs_err, io_args::StaticAnalysisKind}; use dbt_common::{path::DbtPath, tracing::dbt...
a3dfe35130c29a0c20d1ba26e793d3fde9da42fa85b5cc36fe64638211882ca7
Rust
16,668
431
use dbt_common::{ErrorCode, FsError, FsResult, fs_err}; use dbt_schemas::schemas::properties::ModelProperties; use std::collections::HashSet; /// Validates time spine configuration for semantic models according to the rules ported from Python dbt. /// This checks: /// - Standard granularity column exists in model colu...
4eda01c8dfd47d0cad37a36072019597c0c81cbedb522ed798f4eeb0ab7fd31c
Rust
16,671
444
//! Epoch-append parquet for compiled node state. //! //! Files land at: //! ```text //! target/ //! metadata/compile/nodes/v1_{N}.parquet ← epoch-append, latest-wins by unique_id //! ``` //! //! Design: //! * **Schema versioning** — files are named `v{VERSION}_{N}.parquet`. On read, //! files that don't match th...
3ab247f43f0d78dfb0aeb1de592198878fadab4663b15e77730d99eb2cdc9d0e
Rust
16,673
435
use chrono::{DateTime, SecondsFormat, Utc}; use dbt_adapter_core::AdapterType; use dbt_common::{AdapterError, AdapterErrorKind, AdapterResult}; use minijinja::Value; use minijinja::value::ValueKind; use minijinja_contrib::modules::py_datetime::date::PyDate; use minijinja_contrib::modules::py_datetime::datetime::PyDateT...
bd127101defcc9f6c42d524fad696d0f58d662612fdcc892976dd75f4ada8453
Rust
16,688
476
use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; use dbt_schemas::schemas::common::{ConstraintType, DbtUniqueKey}; use dbt_schemas::schemas::nodes::TestMetadata; use dbt_schemas::schemas::project::ResolvableConfig; use dbt_schemas::schemas::{DbtModel, DbtTest, Nodes}; use dbt_yaml::Value as YmlValue; /...
0f9b8f334af3969d2b1580ec236a710c37beaaf4e92dd070a8698c5a3f792f0a
Rust
16,771
432
use dbt_common::{ErrorCode, FsError, FsResult, fs_err}; use dbt_schemas::schemas::properties::ModelProperties; use std::collections::HashSet; /// Validates time spine configuration for semantic models according to the rules ported from Python dbt. /// This checks: /// - Standard granularity column exists in model colu...
a0829bea6b3249113383ba952a525a5d4af9e999fb42553207e34e542812a731
Rust
16,799
447
use std::{path::PathBuf, rc::Rc, sync::Arc}; use dashmap::DashMap; use indexmap::IndexMap; use crate::{ machinery::Span, types::{ funcsign_parser::parse_type, function::{ Argument, BatchFunctionType, FirstFunctionType, FunctionType, ListFunctionType, MapFunctionType, Pr...
4a7136bac4cf8f5b06e32519b14d295e4bad1e27aeecf8e36a4c130c6ee99b00
Rust
16,933
379
//! Pseudoalignment-only mapping (the optional, alignment-free path). //! //! # The trade being made //! //! Pseudoalignment asks only "which transcripts share enough k-mers with this //! read?" and never checks how well the bases actually line up. That is //! dramatically faster — no chaining, no alignment — and for c...
a39e929719d55f03a461dda8426c67de093dd0f31c9bbb917a1fb5cf74433d2a
Rust
17,041
430
use std::collections::HashMap; use std::sync::Mutex; use std::time::{Duration, SystemTime}; use dbt_platform_auth::{AuthChainBuilder, AuthError, Credential, ResolverKind}; use crate::error::{PlatformError, Result}; /// Identifies this SDK to the dbt platform in the OAuth `_dbtsrc` parameter and /// the HTTP `User-Ag...
324fb1f90250b83f301d1def0f48e4190ba71fbba5c590028a31fc05ce9cc55b
Rust
17,066
481
use dbt_telemetry::{HookOutcome, NodeOutcome, NodeSkipReason, NodeType, TestOutcome}; use error::{FsError, FsResult}; use strum::FromRepr; use dbt_tracing::metrics::{MetricKey, get_metric}; const METRIC_KEY_NAMESPACE_SHIFT: u64 = 56; const METRIC_KEY_FAMILY_SHIFT: u64 = 48; const METRIC_KEY_LANE_0_SHIFT: u64 = 40; co...
22c4abcd6ed1bd8022eb28cd0d9a9394414d6b914b3921782843f711f1792637
Rust
17,206
451
//! Format-neutral borrowed alignment records shared by SAM and BAM output. //! //! # Why this module exists //! //! salmon can write its per-fragment mappings as text (SAM) or as the equivalent //! compressed binary (BAM). The two formats encode exactly the same information, //! so if each writer derived flags, CIGARs...
2f14dc5e7a7539ac8282ff16495e0f086584a7d036c9cddfd3dad46dd6be56d9
Rust
17,214
479
use crate::args::ResolveArgs; use crate::dbt_project_config::{ ProjectConfigResolver, RootProjectConfigs, disallow_plus_prefix_from_flags, init_project_config, }; use crate::resolve::resolve_utils::build_unrendered_config; use crate::resolve::resolve_utils::extract_config_map; use crate::utils::{extract_resource_co...
a7dd5b88881fcbc5843e49e499e1ba6f8498b712fbc5a830504a1b00934edc0c
Rust
17,233
461
use std::collections::{BTreeMap, HashSet}; use std::fmt; use std::ops::Deref; use std::rc::Rc; use std::sync::Arc; use dashmap::DashMap; use serde::Serialize; use crate::compiler::ast; use crate::compiler::cfg::build_cfg; use crate::compiler::codegen::{CodeGenerationProfile, CodeGenerator}; use crate::compiler::instr...
0ae834da79cda71fad895987358a10ba074c5105692a8e8190988f4464e661ce
Rust
17,278
521
use adbc_core::options::OptionValue; use dbt_common::{AdapterError, AdapterErrorKind, AdapterResult}; use dbt_schemas::schemas::common::DbtMaterialization; use dbt_schemas::schemas::{DbtModel, DbtSeed, DbtSnapshot, DbtTest, DbtUnitTest}; use indexmap::IndexMap; use minijinja::State; use serde::Deserialize; use serde_js...
7d102d39bf87233eeb4d181ca4c4f8a6e4a7c94e16703b6e31d5afeed2842901
Rust
17,284
408
//! Automatic library-type detection. //! //! # What is being detected, and why //! //! The library type (see [`salmon_core::libtype`]) says how reads relate to the //! RNA they came from: which way the mates point, and whether the protocol //! preserved strand information. Getting it wrong throws away good mappings or...
16b130bf78dd90996a682e9f9c221da527f88069c75c733cfd27b1b2d72d1d9b
Rust
17,353
513
//! Tests for `dbt-snowflake/macros/materializations/dynamic_table.sql`. //! //! The materialization is driven end to end: `relation.from_config(config.model)` and //! `relation.dynamic_table_config_changeset(...)` are the real implementations, so `config.model` //! here is a `DbtModel` serialized exactly the way the r...
fb0de5447bfa3a09d0d10aabf6ecb090fd0e6638b3034bb9c899ffc4fefabe19
Rust
17,403
441
#[cfg(test)] mod tests { use crate::args::ResolveArgs; use crate::dbt_project_config::{DbtProjectConfig, ProjectConfigResolver}; use crate::renderer::{RenderCtx, RenderCtxInner, render_unresolved_sql_files}; use dbt_adapter_core::AdapterType; use dbt_common::io_args::{FsCommand, IoArgs}; use dbt...
80a296c2fe149de6400148bd7646e5d5c8b1fdd98812cd81cb072768f552b94c
Rust
17,667
405
//! Adaptive division of `-p` between gzip decoding and mapping. //! //! `-p` names execution slots, not mapping threads. Some of them have to inflate //! the input before any of them can map it, and the right split depends on the //! compression ratio, on how much work each fragment costs, and on the machine — //! non...
0167909d513909d0e8c5ba3a41d74296cc13e6af2297a94b2725f1b55bd98864
Rust
17,711
483
use std::collections::HashSet; use std::fmt::Write; use crate::compiler::ast; use crate::compiler::tokens::Span; struct AssignmentTracker<'a> { out: HashSet<&'a str>, nested_out: Option<HashSet<String>>, assigned: Vec<HashSet<&'a str>>, } impl<'a> AssignmentTracker<'a> { fn is_assigned(&self, name: &...
f1b0e651d0055f1354349399814f614202c232757404cf8345d3c44454a3687b
Rust
17,793
511
use crate::{AdapterConfig, Auth, AuthError, AuthWarningPrinter, auth_configure_pipeline}; use database::Builder as DatabaseBuilder; use dbt_adbc::{Backend, athena, database}; const DEFAULT_CATALOG: &str = "awsdatacatalog"; const DEFAULT_WORK_GROUP: &str = "primary"; #[derive(Debug)] enum AthenaAuthIR<'a> { Iam, ...
795a20212ab597de97fb1cea720d4fcbedbbf18b8b6fbfdc0de54c1df10bcf72
Rust
18,067
591
use std::time::Duration; use console::Style; use dbt_telemetry::{Invocation, NodeType}; use dbt_tracing::SpanEndInfo; use itertools::Itertools; use crate::tracing::{ data_provider::DataProvider, dbt_metrics::{FusionMetricKey, InvocationMetricKey}, formatters::{ color::{BLUE, DIM, GREEN, MAGENTA, ...
421be8040ad219b5c38b26eb89d541d8c5de1c56cfe0f18194fbc9c5393c2ea1
Rust
18,076
527
//! Round-trip and concurrency tests for salmon RAD output. use std::io::{Cursor, Read}; use libradicl::chunk::Chunk; use libradicl::header::RadPrelude; use libradicl::rad_types::TagValue; use salmon_rad::{ detect_input_profile, frag_map_type, ChunkCodec, FragmentChunkBuf, RadHit, RadInputProfile, RadOutputW...
87f20f37155387b8bef00c699d2c3ddf06fd6931b771f7cdcb67dd520527d318
Rust
18,093
482
//! Tests for FQN project-config construction. //! //! The code under test lives in `dbt-schemas` (re-exported as //! `crate::dbt_project_config`), but these tests need `dbt-jinja-utils` to //! deserialize the YAML fixtures, and that crate sits above `dbt-schemas` — a //! dev-dependency back would be a cycle. So they l...
e7919c559fccc85887e275c8b3084f4dca53bad3baa0fc3103f941c8f5017b26
Rust
18,194
474
use std::collections::BTreeMap; use dbt_adapter::relation::RelationObject; use dbt_adapter_core::AdapterType; use dbt_schemas::dbt_types::RelationType; use minijinja::Value; use crate::macro_test_harness::{MacroTestHarness, resolved_quoting_for}; mod databricks { use super::*; fn build_comment_on_column_har...
4ab9af3722d7229107b3ad67e6119f66f26ee8e668119445dd4b676e4df22e7b
Rust
18,266
460
//! Macro / namespace lookup `Object` impls — std-only types moved here from //! `dbt-jinja-utils` so the typed parse/compile/run-phase ctx structs can //! hold them via `JinjaObject<T>` rather than opaque `MinijinjaValue`. //! //! Naming note: this module's [`DbtNamespace`] is the *dispatch-side* //! namespace — it in...
e4e7c0a9462ad4f7a1b329c49ebaa0e9d05270bd90deff7ba30da63bf0206a24
Rust
18,411
532
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/row_filter.py use dbt_common::AdapterResult; use dbt_schemas::schemas::{DbtModel, InternalDbtNodeAttributes}; use minijinja::Value; use serde::Serialize; use crate::errors::{AdapterError, AdapterErrorKind}; use crate::...
9e50246277aa8edf07bb07eca19b416def4c945603c8756a48695ef65a5d7bcf
Rust
18,434
540
use std::collections::HashSet; use std::sync::Mutex; use dbt_common::ErrorCode; use dbt_common::tracing::dbt_emit::{emit_info_log_message, emit_warn_log_message}; use dbt_schemas::schemas::packages::{DbtPackageEntry, DbtPackages, DbtPackagesLock}; use crate::types::HubPinnedPackage; use crate::utils::scrub_package_na...
5db1744f2c47d240cc0624186c4ebdb84b022ae9a606950fa9842ac0fa715ace
Rust
18,492
551
//! Global functions and abstractions. //! //! This module provides the abstractions for functions that can registered as //! global functions to the environment via //! [`add_function`](crate::Environment::add_function). //! //! # Using Functions //! //! Functions can be called in any place where an expression is vali...
03861880effc9162c1584a336c22e4cffa72eb8cd732298757beb2d934f5b13a
Rust
18,676
852
use std::io::Write; use std::process::Command; use insta_cmd::{assert_cmd_snapshot, get_cargo_bin}; use tempfile::NamedTempFile; fn cli() -> Command { Command::new(get_cargo_bin("minijinja-cli")) } fn file_with_contents(contents: &str) -> NamedTempFile { file_with_contents_and_ext(contents, "") } fn file_wi...
1016ed4177fa45d537e7c9d54f334046014f89fa1db543adb5f3fe9c6308f866
Rust
18,680
612
use std::{fmt, marker::PhantomData}; use crate::dashmap::DashMap; use indexmap::IndexMap; use minijinja::value::ValueMap; use minijinja::value::mutable_vec::MutableVec; use serde::{ Deserialize, Deserializer, Serialize, de::{Visitor, value::UnitDeserializer}, }; type YmlValue = dbt_yaml::Value; /// Converts ...
7e5329aaf7969a6112226dabfb0858838fa1c2a94b26814e0e24a00eebd9abae
Rust
18,714
500
use crate::args::PackArgs; use crate::pyproject::{self, Spec}; use crate::release_version::parse_release_version; use anyhow::{Context, Result, anyhow, bail}; use base64::Engine; use sha2::{Digest, Sha256}; use std::fmt::Write as _; use std::fs::{self, File}; use std::io::Write as _; use std::path::{Path, PathBuf}; use...
1d9c42b81d55b3c011a9813b64a790473c508867809070b8b1306cb1644d0e6e
Rust
18,763
492
//! The engine glue every dbt distribution's Python extension module shares. //! //! A distribution supplies its CLI surface and feature set via [`Distribution`] //! and calls [`register`] from its `#[pymodule]`; everything else lives here. use dbt_clap_core::commands::{Command, CoreCommand}; use dbt_clap_core::{Cli, ...
2eab0a5629034b2237bf21184cb443edc493b87e90afab522017d0ee8326b34d
Rust
18,791
495
use std::borrow::Cow; use std::cell::RefCell; use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; use std::sync::Arc; use dbt_adapter_core::AdapterType; use dbt_adapter_engine::ConnectionFactory; use dbt_adbc::Connection; use dbt_common::AdapterResult; use dbt_common::cancellation::Cancellable; use dbt_tele...
ab85efa114e146305471d0b8f22d1de93898af329fbb6e08dafe0119c120cf5c
Rust
18,852
550
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...
5ca345f807c25f256542a140af0b05c523f2441d9b722a06823031dd820ca44d
Rust
18,878
508
//! https://github.com/databricks/dbt-databricks/blob/main/dbt/adapters/databricks/relation_configs/column_comments.py use crate::errors::AdapterResult; use crate::relation::config_v2::{ ComponentConfig, ComponentConfigLoader, SimpleComponentConfigImpl, impl_loader, }; use crate::relation::databricks::config::{ ...
9715438a1b464b30dd63e260a8b0a3b62cabf522b7e464d22606760c70af00f8
Rust
18,917
489
use std::collections::HashMap; use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; use minijinja::{Error, ErrorKind}; use regex::{Captures, Regex}; // See: https://docs.rs/regex/latest/regex/struct.Regex.html#method.replace_all fn try_replace_all<E>( re: &Regex, haystack: &str, replacement: impl Fn(&Captur...
2fb99a8e3cd13595dec7ee413e56a16e3d92508e8bb2745a6ce9a77d78e2ef55
Rust
18,967
553
//! A builder for a [`Database`] //! //! use adbc_core::{ error::{Error, Result, Status}, options::{OptionDatabase, OptionValue}, }; use core::str; use dirs; use ini::ini; use percent_encoding::percent_decode_str; use std::fmt; use url::Url; use crate::database::fingerprint_config; use crate::{Backend, Databa...
beedf40c6b51c45f66f4b12dab36ddd453b7b8582a5f8ddf8e904a12f50226f7
Rust
18,968
549
use arrow::array::RecordBatch; use arrow::ipc::reader::StreamReader as ArrowStreamReader; use arrow::ipc::writer::StreamWriter as ArrowStreamWriter; use arrow_schema::Schema; use base64::Engine; use base64::engine::general_purpose::STANDARD as BASE64_STANDARD; use rusqlite::params; use std::collections::BTreeMap; use s...
b136749df23effb18d4698fbeb33bb8430606645f6d12e0ef2ff019b42f7b309
Rust
18,975
414
//! The salmon RAD output writer. //! //! # The concurrency shape //! //! Mapping runs on many threads at once, and all of them produce records for the //! same output file. Having every thread lock the file per record would serialize //! the whole run, so the work is split in two: //! //! * each worker thread owns a p...
bf7be1b024ef0dbeacc9344798d647873272ba7ae3f10f7bbefe80ad6e3d1717
Rust
19,140
551
//! Package addition functionality for dbt-deps //! //! This module provides functionality for adding packages to `packages.yml` files. //! It includes utilities for: //! - Converting package strings to structured data //! - Checking for duplicate packages //! - Creating properly formatted package entries //! - Adding ...
7f01fe427645019376fdebc6f5bf2448472c6e36800aebc2ed506a3795aea088
Rust
19,236
432
use dbt_common::io_args::IoArgs; use dbt_common::tokiofs; use dbt_common::tracing::dbt_emit::emit_warn_log_message; use dbt_common::{ErrorCode, FsResult, constants::DBT_PACKAGES_LOCK_FILE, err, fs_err, stdfs}; use dbt_jinja_utils::jinja_environment::JinjaEnv; use dbt_jinja_utils::serde::from_yaml_raw; use dbt_schemas::...
d27b41b8f4e870779dbbd046fd00448a9959942e516d4225da28c3f4ee4dde28
Rust
19,314
573
use crate::ident::{ ColumnRef, FullyQualifiedName, LOWERCASE_DRAFT_SUFFIX, QualifiedName, UPPERCASE_DRAFT_SUFFIX, }; use super::error::{InternalError, InternalResult, internal_err}; use super::ident::Identifier; use crate::make_internal_err; use serde::{Deserialize, Serialize}; use std::{fmt::Display, str::FromStr...
9f6d0240a989a062aea0486fc2c4ea0358acd5ed91280b341437ea305212e8b3
Rust
19,480
548
//! Snowflake compatibility tests for the MetricFlow semantic query compiler. //! //! Two modes: //! //! - **Replay** (default): loads pre-recorded results from //! `tests/data/snowflake_recordings.parquet`. No Snowflake connection needed. //! ```sh //! cargo test -p dbt-metricflow --test snowflake_compat //! ...
d5c3c1317165bec8e5bf08d06309c02ba7c341f6cf8241b209f9a58ad26e9fa3
Rust
19,509
657
use crate::AdapterResponse; use crate::adapter::adapter_impl::AdapterImpl; use crate::engine::Options; use adbc_core::options::OptionValue; use dbt_adbc::bigquery::{ CREATE_BATCH_REQ_BATCH_ID, CREATE_BATCH_REQ_BATCH_YML, CREATE_BATCH_REQ_PARENT, CREATE_NOTEBOOK_EXECUTE_JOB_REQ_GSC_BUCKET, CREATE_NOTEBOOK_EXECU...
c74ffaae756b60670c3ad3a8dbdfd47918bdc93b5f1f9a77e03a1953836d982f
Rust
19,525
515
use crate::compiler::instructions::Instructions; use crate::constants::{CURRENT_PATH, CURRENT_SPAN}; use crate::dispatch_object::{macro_namespace_template_resolver, DispatchObject}; use crate::environment::Environment; use crate::error::{Error, ErrorKind}; use crate::listener::RenderingEventListener; use crate::machine...
4fdae7fbf6e9d51560e016f65ec989971db675e0f175726e7afb5099049bb7c4
Rust
19,663
508
#![allow(dead_code, unused_mut, reason = "TODO: implement")] use std::borrow::Cow; use crate::{AdapterConfig, Auth, AuthError, AuthWarningPrinter}; use dbt_adbc::{ Backend, database::{self, Builder as DatabaseBuilder}, }; const DEFAULT_AUTH: &str = "ActiveDirectoryServicePrincipal"; const DEFAULT_PORT: &str...
c79f2570b05462b0cf1cbc03e2371715a0a5773e6bfa846af41a46cd1878d5c1
Rust
19,830
514
use base64::{Engine as _, engine::general_purpose::STANDARD}; use pkcs8::der::{Decode, oid::ObjectIdentifier}; use pkcs8::{EncodePrivateKey, EncryptedPrivateKeyInfo, LineEnding, PrivateKeyInfo}; use rsa::{RsaPrivateKey, pkcs1::DecodeRsaPrivateKey}; use crate::AuthError; #[derive(Debug)] pub enum SnowflakeKeypairStatu...
25565234359483b639fd3fc98f984391f8478bd88d1067a0a3d397d57ccc7dad
Rust
19,866
521
//! Hashers of Arrow rows. //! //! use arrow::array::{AsArray as _, PrimitiveArray}; use arrow::buffer::{BooleanBuffer, NullBuffer, ScalarBuffer}; use arrow::datatypes::*; use arrow_array::{ Array, ArrowPrimitiveType, BooleanArray, GenericByteArray, GenericByteViewArray, OffsetSizeTrait, }; use arrow_buffer::i...
dad460bf7bfe697abb03d7c78fcbaa3e082e1844254918882edf89a3e588a803
Rust
19,915
370
/// This module defines the command-line interface for the CLI. /// It is separated into its own file because it is used both by the main /// application and by build.rs to generate shell completions. use std::path::PathBuf; use clap::builder::ArgPredicate; use clap::{arg, command, value_parser, ArgAction, Command}; ...
ac8fe5ea6ef32664ad529064f73cbe8d8d97e6534c9cea13009d6dad8301f4f4
Rust
19,931
530
// Allow disallowed methods for this module because RustEmbed generates calls to Path::canonicalize #![allow(clippy::disallowed_methods)] use crate::profile_setup::{ProfileAction, ProfileSetup}; use dbt_common::pretty_string::{GREEN, YELLOW}; use dbt_common::tracing::dbt_emit::emit_info_log_message; use dbt_common::{E...