sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
76e318e9dfe0dcb0d6848241e684bba147279f5e9426d7665dc057d42b8e9b0d | R | 200,205 | 5,122 | setwd("Users/jvaug/Documents/Lipidomics/Processed")
####LOADING LIBRARIES##########################
#install.packages("ggfortify", dependencies = TRUE)
#install.packages("ComplexHeatmap")
#install.packages("svglite")
#if (!require("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
# install.packages('g... |
fcb234f0a022db6d8333b926f9f8128177abe924f210fb07aabe58012578d455 | Rust | 12 | 1 | mod driver;
|
d41b484977c59016ad0e4093c35c3baebdd95f98037cd01ad9d0b04d199e3127 | Rust | 17 | 1 | pub mod adapter;
|
ef54eff63d3879327045c3ef3d82e18b8c1bcf09b58309d05495f6352c54c148 | Rust | 19 | 1 | pub mod freshness;
|
d3a5392f2ccab493496ad361dda8a94c47b02ffbdbf13d702233c71acfea5a2f | Rust | 20 | 1 | pub mod continuous;
|
ce71c0aa842c12f70c46eaeb03f34aed3a8ff89acc2ff7a6d4f3a1b9cea35bf3 | Rust | 23 | 1 | pub(crate) mod config;
|
4568205338f56d6261f226915e45f2d031014b925730eeeabaf638746199c3fc | Rust | 24 | 1 | pub use dbt_auth::Auth;
|
615acbf4eb42a799fa22cfe2582df0f7189e4f394777d84b1f0c21aef575384e | Rust | 33 | 2 | pub mod publish;
pub mod render;
|
76c72adbb7a72d8e43ea4cf054c9adf14df4d87c4b11857a64365862fac8a501 | Rust | 34 | 1 | pub(crate) mod materialized_view;
|
c7c84c34e4a5aa6604bfc350ece52022e606c0e924bece8616fabb74369ea95f | Rust | 34 | 1 | pub mod materialized_view_config;
|
3a6976899eef062fa8f3330d0baf316a2d079ad882f5bb55715938ce2b2accbd | Rust | 36 | 2 | pub mod binary;
pub mod continuous;
|
f8bf514978ea102095f92bf32b251e11c90f67a3dac8cd5bfdd9338bd2fe0051 | Rust | 37 | 2 | pub mod deps_mgmt;
pub mod schedule;
|
8c16bcfbdd5bf94bf5a721b40152a988753c080fbacdba3aec1f6659b6d41200 | Rust | 40 | 1 | pub(in crate::tracing) mod print_event;
|
4956cb283c0c1f9de95aa1b581791b3033312ada98832710e5f983b16f6092f5 | Rust | 56 | 2 | mod defaults;
pub use defaults::DEFAULT_SPARK_DATABASE;
|
145174d7df5ade1dff684eecc9ee50364b43e08382fd2b48c92e3767edebc134 | Rust | 57 | 3 | pub mod binary;
pub mod continuous;
pub mod exponential;
|
462a5a9e51618c520a413e439fade73b98b0b0b55212e26c8e9cf912c994d0ef | Rust | 57 | 3 | pub mod bigquery;
pub mod databricks;
pub mod snowflake;
|
646b31f03082bc8e7fd1de4f2db9cf26e6fec4ae537dbfc882073015246f08d1 | Rust | 59 | 4 | mod macro_test_harness;
mod macros;
mod materializations;
|
c3e8c3df89bc290a26f2999f27513d644d1530314fa02f4aa5d710235ab32144 | Rust | 61 | 5 | pub mod diff;
pub mod normalize;
pub(crate) mod tokenizer;
|
7213179d84adfd6902dd1c2ded5f706929135eef44192032bb0a2e3e716eb983 | Rust | 63 | 2 | pub mod env;
pub use env::{env_var_bool, env_var_is_disabled};
|
2390c3607b5b54e3e937f3d0d8cd1b20a7ee54b1009b5620f644bc3842a4b45a | Rust | 64 | 2 | pub(crate) mod dynamic_table;
pub(crate) mod interactive_table;
|
1850d14f5dbf7440e79050d05d9daed42180830630686016c6090c47634142da | Rust | 67 | 4 | pub mod py_datetime;
pub mod pytz;
pub mod re;
pub mod validation;
|
de81a00560ce9c44ce2d9adb2fd28df7704f34b7fc92c32d882815539217afd4 | Rust | 79 | 4 | use im::HashSet;
pub type Label = String;
pub type LabelSet = HashSet<Label>;
|
c2111434f790025bc2cdacb64486a86497d4fe194cde6acc2dd44d5d9d091462 | Rust | 87 | 4 | pub mod observations;
pub mod posterior;
pub mod prediction;
pub mod prediction_error;
|
fa43fed63c77215e6ee52da6bf10ec8176bf9489754cd0e4a3a9af2a866652ab | Rust | 87 | 3 | pub(crate) mod components;
pub(crate) mod relation_types;
pub(crate) mod test_helpers;
|
b7b99e6d15516db544a15004cdc7df4ce7529a0f40047d31a928d46596d0598c | Rust | 104 | 5 | use minijinja::render;
fn main() {
println!("{}", render!("Hello {{ name }}!", name => "John"));
}
|
95cda49e4756459d15520884a28b5bbfc7fb8b784fa1dbb3f884363bdd763a18 | Rust | 108 | 4 | pub mod beliefs_propagation;
pub mod function_pointer;
pub mod set_sequence;
pub mod weight_initialisation;
|
1c86804b098be1550caafe0c4db235ad31659641c33dd0ed3af242e3db6e420f | Rust | 113 | 7 | use std::sync::Arc;
use dbt_login::LoginHooks;
pub struct LoginFeature {
pub hooks: Arc<dyn LoginHooks>,
}
|
14a9618df3f6be04fd1a0cafb422f2c461cc3174708d5a362788fcd80170ed3c | Rust | 119 | 5 | //! The dbt Adapter Engine.
pub mod map_reduce;
pub use map_reduce::ConnectionFactory;
pub use map_reduce::MapReduce;
|
fa9d3dd98d8a055b76e66167c47b05e48d50c0a4cc0f3f7f2c09b5a3805167ca | Rust | 129 | 6 | pub mod file_registry;
pub mod index_resolution;
pub mod parse_cache;
pub mod parse_state;
pub mod partial_parse;
pub mod types;
|
c1f3c5a3825e8b0267df067eea9dac0523d15e228082451cc04a7b0c803d9867 | Rust | 130 | 5 | mod column_builder;
pub use column_builder::ColumnBuilder;
mod types;
pub use types::{BigqueryColumnMode, Column, ColumnStatic};
|
fa9f599782e6449f3a7861b82a6b7a5d42e2ed45209dba812d402ce9b7db0b64 | Rust | 130 | 7 | mod dynamic_table;
mod incremental;
mod interactive_table;
mod materialized_view;
mod metric_view;
mod streaming_table;
mod view;
|
ef49e30cd87c8b4438d73a734c6991e541f7fcc2150944d0b4831578711a5387 | Rust | 132 | 8 | mod eval;
mod ir;
mod parse;
mod tokenize;
pub use eval::{Bindings, Evaluator, Value};
pub use ir::Expr;
pub use parse::try_parse;
|
2921b1308748f561aacc38bd59db998d488d3e5fce6ac5081b1752e37a08f0a0 | Rust | 139 | 7 | use std::sync::Arc;
use dbt_parser::resolver_hooks::ResolverHooks;
pub struct ResolverFeature {
pub hooks: Arc<dyn ResolverHooks>,
}
|
547591e143660c27e7938110687c226e383d32633904c0eee73202048df74b1e | Rust | 140 | 5 | use crate::types::DynObject;
use std::collections::BTreeMap;
/// macro signatures
pub type FunctionRegistry = BTreeMap<String, DynObject>;
|
008d0de2824b0b3c267afe16931c81c3d45201c6eb1f41ab90ca3f3871331bf1 | Rust | 147 | 8 | #![allow(clippy::too_many_arguments)]
pub mod config;
pub mod core;
pub mod schedule;
pub mod schema_hydration;
pub mod timezone;
pub mod traits;
|
51c8f7ca6d1656c1cb5b66fb90e45620503d4e1e05a6a8e67e80c48ea99b0984 | Rust | 156 | 5 | //! Vectorised kernels for binary (Bernoulli) leaf layers, mirroring
//! `pyhgf/updates/vectorised/binary/`.
pub mod prediction;
pub mod prediction_error;
|
b6c33402bc0f43a6d3b038e7c0da4edd41efb7916083ec34f4f57b2feb2724bd | Rust | 163 | 4 | use std::collections::BTreeMap;
use std::sync::{OnceLock, RwLock};
pub static DISPATCH_CONFIG: OnceLock<RwLock<BTreeMap<String, Vec<String>>>> = OnceLock::new();
|
618c478b87d3c3de1df96498b6e1f0cee1c8b73aaaac0ced90ae81f14d4951f6 | Rust | 164 | 5 | //! Vectorised kernels for categorical (softmax) leaf layers, mirroring
//! `pyhgf/updates/vectorised/categorical/`.
pub mod prediction;
pub mod prediction_error;
|
3ab054ea286c61bb9bee5013373ef60c5e970dbd007110fd1a50ed110db10353 | Rust | 168 | 8 | #![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|input: &str| {
minijinja::Environment::new()
.add_template("fuzz.txt", input)
.ok();
});
|
24d7995ef655c9c552b47ce8dc5c577f1753460ee9d1a3aaa352452471953e63 | Rust | 171 | 6 | // Composable middleware layers
pub mod markdown_log_filter;
pub mod metric_aggregator;
pub mod node_warn_outcome;
pub mod parse_error_filter;
pub mod warn_error_options;
|
0a1c9a82deaa0a742fa716b3d13d3db6b2041bd7eb5df05413b75bfa0e5384f8 | Rust | 181 | 7 | pub use dbt_tracing::layers::data_layer::TelemetryDataLayer;
// Composable consumer layers
pub mod file_log_layer;
pub mod json_compat_layer;
pub mod query_log;
pub mod tui_layer;
|
5356d4a8df9860fc26bd8a2bd5530933faeac855d9acaacae2b4a610d067fa80 | Rust | 181 | 7 | mod config_tests;
mod dbt_emit_tests;
mod dbt_middleware_tests;
mod invocation_shutdown_tests;
mod layers_file_log_tests;
mod layers_json_compat_tests;
mod metric_aggregator_tests;
|
85592ae630d45745954b98728ea1bbc2ef66c0111058790fc1ee2842057aeb28 | Rust | 187 | 5 | //! Python-facing model classes, mirroring `pyhgf/model/`: the per-node
//! [`network::Network`] and the vectorised [`deep_network::DeepNetwork`].
pub mod deep_network;
pub mod network;
|
c52853a206030583a0ca375685d63f887b60abe6702c5f834d5a88ffa67689c9 | Rust | 197 | 6 | #![allow(unused_imports)]
// since Rust thinks these are test modules...
pub(crate) mod persist_generic_data_tests;
pub(crate) mod resolve_data_tests;
pub(crate) mod resolve_unit_tests;
mod utils;
|
07e55d6e60cb17b97a1e30d21757eaff6e128943c4a1ce0ddbd7dc938cdae6df | Rust | 198 | 8 | fn main() {
// we only need to bundle the templates with the
// feature is enabled.
#[cfg(feature = "bundled")]
{
minijinja_embed::embed_templates!("src/templates");
}
}
|
b01cfa07109687412b51f22f4e6f605844720d17b085b431a6ecf6d15e8d66f6 | Rust | 200 | 9 | pub mod adapter_config;
pub mod dbt_cloud_client;
pub mod init;
pub mod profile_setup;
// Re-export the main types and functions
pub use adapter_config::*;
pub use init::*;
pub use profile_setup::*;
|
b06689062cfb202cc5c6efec7434edfe9cb302462b9403e1e705f97940e02d18 | Rust | 211 | 6 | // Emit the linker arguments an extension module needs on macOS.
//
// This call is a no-op on every non-Apple target, so CI is unaffected.
fn main() {
pyo3_build_config::add_extension_module_link_args();
}
|
32a63c5d1decd121fdfe7add67181986d42abded27483ec88c1634935fff406c | Rust | 216 | 9 | // include the generated file
include!(concat!(env!("OUT_DIR"), "/example.rs"));
fn main() {
println!("build cwd: {BUILD_CWD}");
for point in POINTS {
println!("({}, {})", point.x, point.y);
}
}
|
7f69765aa79b06e173e86027b18fbfb4619c43cf8199054307090545be276c01 | Rust | 225 | 11 | #![allow(missing_docs)]
/// This module contains the internals of the compiler.
pub mod ast;
pub mod cfg;
pub mod codegen;
pub mod instructions;
pub mod lexer;
pub mod meta;
pub mod parser;
pub mod tokens;
pub mod typecheck;
|
fd7e1bb91067916f9fe736d8c88c42e5fb2fc20460ea026e10bcdae08f86f4fe | Rust | 225 | 9 | use std::sync::Arc;
use dbt_jinja_utils::JinjaFactory;
/// Jinja-related services. Exposes the [`JinjaFactory`] used to create rendering
/// environments.
pub struct JinjaFeature {
pub factory: Arc<dyn JinjaFactory>,
}
|
a6c2b3f8f850d0d0856c38bea1328769dc93e5da214b196406faa2f4c3e4eca8 | Rust | 232 | 12 | #![allow(unused_imports)]
#![allow(clippy::too_many_arguments)]
#![allow(non_snake_case)]
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_repr;
extern crate url;
pub mod apis;
pub mod models;
|
8b196ab7a6fbc8d15a42f243897ab61cbd7ddecbb6ad0e2de3a90a4257ac61af | Rust | 239 | 9 | use std::sync::Arc;
use dbt_adapter::adapter::AdapterFactory;
use dbt_adapter::sql_types::TypeOpsFactory;
pub struct AdapterFeature {
pub type_ops_factory: Arc<dyn TypeOpsFactory>,
pub adapter_factory: Arc<dyn AdapterFactory>,
}
|
ffd7091ec95f6e3d994da7e643335efbf3f5bf8d0a5a77984372c54003c6ba93 | Rust | 241 | 14 | mod aggregated_tests;
mod bigquery;
mod contract_wrappers;
mod databricks_catalog;
mod databricks_metadata;
mod delete_insert;
mod duckdb;
mod equals;
mod multi_adapter;
mod persist_docs;
mod python;
mod relations;
mod snowflake;
mod spark;
|
aab5810008f4010c5f98828b1d0fe87e48b6d63066f4d949460b8adc25431d84 | Rust | 244 | 6 | //! Belief-update kernels, split by backend: `nodalised` (per-node scalar
//! updates) and `vectorised` (matrix updates over whole layers), mirroring
//! `pyhgf/updates/` and `pyhgf/updates/vectorised/`.
pub mod nodalised;
pub mod vectorised;
|
5ef1d157e655e6b547817f90ba683510707e45a3e86ef933a6a21456f9f341a4 | Rust | 247 | 6 | pub fn code_hash(code: &str) -> String {
// Compute a 16-byte (128-bit) BLAKE3 hash and return as hex string
let hash = blake3::hash(code.as_bytes());
// Truncate to 16 bytes and encode as hex
hex::encode(&hash.as_bytes()[..16])
}
|
9b0ad247d32c080feed2e79d58eddefaad7dfa6ebb482368883caade224992c2 | Rust | 250 | 5 | //! Re-export of the profile/adapter configuration schemas.
//!
//! The implementation lives in the `dbt-profile-schemas` crate; this module
//! re-exports it so existing `crate::adapter_config::*` paths keep working.
pub use dbt_profile_schemas::*;
|
eee394c6744cf4bf63f3e615888475c9e8c38f41eb1d86283b8aeed723513ab9 | Rust | 262 | 8 | //! Small platform primitives for creating files and directories with a
//! protected owner-only discretionary access control list.
#[cfg(windows)]
mod windows;
#[cfg(windows)]
pub use windows::{ensure_owner_only_dir, open_owner_only, owner_only_tempfile_in};
|
0abf0a9ec3f16be2b5ac33e2d5091c4f7c93c075bb84267496d15a8974783d35 | Rust | 277 | 8 | /// This module contains the functions implementations for the dbt jinja context
pub mod base;
/// This module contains the contract_mismatches function for comparing YAML and SQL column definitions
mod contract_error;
pub use base::*;
pub use dbt_jinja_vars::ConfiguredVar;
|
88677e4e5fbd071a01dab459c3e25081483779929175cd833abf4c0c585fd8e5 | Rust | 278 | 16 | mod cli;
mod command;
mod config;
mod output;
#[cfg(feature = "repl")]
mod repl;
fn main() {
match cli::execute() {
Ok(code) => std::process::exit(code),
Err(err) => {
cli::print_error(&err);
std::process::exit(1);
}
}
}
|
acc097045c6184aecca399006c761b1612961805098f8fed5b6996a8f3866b11 | Rust | 278 | 16 | #![allow(non_camel_case_types)]
#![allow(missing_debug_implementations)]
#![allow(unreachable_pub)]
#![allow(clippy::missing_safety_doc)]
#[macro_use]
mod macros;
mod utils;
mod env;
mod error;
mod value;
pub use self::env::*;
pub use self::error::*;
pub use self::value::*;
|
d7678a81e8aec23d3ca393308fada230cdd608883cbeea4355656721f43a97f9 | Rust | 280 | 8 | //! Module for the compile phase
mod compile_config;
mod compile_node_context;
pub use compile_node_context::DependencyValidationConfig;
pub use compile_node_context::REPL_MODEL_NAME;
pub use compile_node_context::{build_compile_node_context, build_compile_node_context_inner};
|
5feea4186bc816e5202a3af6659d27edcf6bb95b37d567698d274d71c6e784fa | Rust | 287 | 10 | //! Module for configuring the jinja environment for the run phase
mod run_config;
mod run_node_context;
pub use run_config::RunConfig;
pub use run_node_context::{
WriteConfig, build_run_node_context, build_run_node_ctx, extend_base_context_stateful_fn,
reset_result_store,
};
|
e6744d2a58800663a3033456053775a1c415592a2c73ccea710c88a0670577c4 | Rust | 288 | 8 | use minijinja::{context, Environment};
fn main() {
let mut env = Environment::new();
env.add_template("hello.txt", "Hello {{ name }}!").unwrap();
let template = env.get_template("hello.txt").unwrap();
println!("{}", template.render(context!(name => "John")).unwrap());
}
|
deadee3dc30455e5460edb2fab1ad7f171f7d60d3aa7f5a10fa7c2c4191b2b00 | Rust | 293 | 13 | pub mod args;
pub mod bump_cargo_version;
pub mod homebrew;
pub mod pack;
pub mod publish;
pub mod pyproject;
pub(crate) mod release_version;
pub(crate) mod sdist;
pub mod utils;
pub use args::{
BumpCargoVersionArgs, HomebrewPublishArgs, HomebrewRenderArgs, PackArgs, PypiPublishArgs,
};
|
c8cf0a5a701e930353d037b168d98d1eb6e4ac2aec23bef868b338445dc09b1f | Rust | 299 | 9 | use std::sync::Arc;
pub use dbt_tasks_core::metricflow::{MetricflowClient, MetricflowClientFactory};
/// Metricflow feature slot on [`FeatureStack`](super::feature_stack::FeatureStack).
#[derive(Default)]
pub struct MetricflowFeature {
pub factory: Option<Arc<dyn MetricflowClientFactory>>,
}
|
7f1ba19dfa738504bae5280c7ece006059e7f2dc52622c1d7d92e0d5e9ea19f1 | Rust | 300 | 13 | pub mod catalog_columns;
pub mod catalog_stats;
pub mod cll_epoch;
pub mod compile_columns;
pub mod compiled_node;
pub mod epoch_io;
pub mod invocations;
pub mod parse_alive;
pub mod parse_columns;
pub mod parse_nodes;
pub mod parse_test_metadata;
pub mod runtime_freshness;
pub mod runtime_results;
|
17100ea8655d2104487018d02ee0367d95afd15d35bb9ac909c66fcd3f3989a9 | Rust | 304 | 11 | #[derive(Debug, thiserror::Error)]
pub enum IndexError {
#[error("ADBC error: {0}")]
Adbc(#[from] adbc_core::error::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("{0}")]
Other(String),
}
|
c20b351786e5fc06656d66783ff3e4edafebf8d075442266e71f3323c33809bd | Rust | 313 | 11 | use dbt_schemas::schemas::profiles::DbConfig;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProfileTarget {
pub target: String,
pub outputs: HashMap<String, DbConfig>,
}
pub type Profiles = HashMap<String, ProfileTarget>;
|
e6e6058b148ec7023a24f9bb5a07af5024a54246a5284834b5479891d18ee13b | Rust | 314 | 14 | use pyo3::prelude::*;
mod environment;
mod error_support;
mod state;
mod typeconv;
#[pymodule]
fn _lowlevel(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<environment::Environment>()?;
m.add_class::<state::StateRef>()?;
m.add_class::<error_support::ErrorInfo>()?;
Ok(())
}
|
671f02ea8eec5ae18a8b36055a0973a7e916a09bb2fb0ac0416c0217ea83a10a | Rust | 316 | 6 | /// Default Spark database
///
/// Spark relations have no catalog/database, so an absent database resolves to empty. Note,
/// the terms `database` and `schema` are interchangeable in Spark
/// https://spark.apache.org/docs/latest/sql-ref-syntax-aux-show-databases.html
pub const DEFAULT_SPARK_DATABASE: &str = "";
|
2ec6c0d1acf3967b2192bd51fc04ce28652102202d439eb59b095d25d88108e0 | Rust | 325 | 18 | pub mod asset;
pub mod color;
pub mod connection_limit_wait;
pub mod constants;
pub mod deps;
pub mod duration;
pub mod generic;
pub mod hook;
pub mod invocation;
pub mod layout;
pub mod log_message;
pub mod meta;
pub mod node;
pub mod phase;
pub mod progress;
pub mod query_log;
pub mod state_mod_diff;
pub mod test_res... |
ad8718aa13ee0bbbb994664b2659729ad03888b838eff62b1ac981ebc8733cf3 | Rust | 329 | 12 | use minijinja::{context, Environment};
fn main() {
let mut env = Environment::new();
env.add_template("hello.txt", include_str!("hello.txt"))
.unwrap();
let tmpl = env.get_template("hello.txt").unwrap();
println!(
"{}",
tmpl.render(context!(names => ["John", "Peter"])).unwrap()
... |
5f3a3b94a63f35b690f08464aa17710d5bdaefaa22c48e4b74d80b4291268661 | Rust | 346 | 11 | use dbt_schemas::schemas::serde::StringOrArrayOfStrings;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
pub struct SnapshotStrategy {
pub unique_key: Option<StringOrArrayOfStrings>,
pub updated_at: Option<String>,
pub row_changed: Option<String>,
pub scd_id: Option<String>,
pub hard_d... |
3a148f893cb70a5fbedf9021b5f95983d5566165bc4a143b0e2518df94a70b95 | Rust | 348 | 13 | use minijinja::{context, Environment, Value};
fn main() {
let env = Environment::new();
// this just demonstrates that `context!` creates a `Value`
let ctx: Value = context! {
name => "Peter"
};
// Which can be directly passed to `render_str`.
println!("{}", env.render_str("Hello {{ n... |
97264fe30fbf2449b292c52e38183ac664cde5e7845c77a875bafb4fb8dfcbb0 | Rust | 349 | 12 | pub mod compile;
mod compile_and_run_context;
pub mod load;
pub mod parse;
pub mod run;
mod utils;
pub use compile_and_run_context::{
MacroLookupContext, MicrobatchRefContext, RefFunction, SourceFunction, build_compile_base_ctx,
build_operation_context, build_operation_context_btreemap,
configure_compile_a... |
c314df1da816a425ce1e8b40cda12d1bc031733c69f85caaf5bf80946b08f745 | Rust | 349 | 11 | pub mod adapter_config;
pub mod dbt_cloud_client;
pub mod init;
pub mod profile_setup;
pub mod yaml_utils;
pub extern crate dbt_error as error;
pub use dbt_error::{
CodeLocationWithFile, ErrContext, ErrorCode, FsError, FsResult, LiftableResult, MacroSpan,
Span, ectx, err, fs_err, not_implemented_err, unexpecte... |
0950f0fae6b8cebd1b00bb0a4244b5bf21f49a31e615072dd9fb4fa1e945635f | Rust | 352 | 6 | /// Default databricks database
pub const DEFAULT_DATABRICKS_DATABASE: &str = "hive_metastore";
/// https://docs.databricks.com/aws/en/admin/system-tables/
pub const SYSTEM_DATABASE: &str = "system";
/// https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-information-schema
pub const INFORMATION_SCHEMA_SCHEM... |
ba5d312c6cb1a2875d1861f8f650a26fe613698b5093ae928d51165f0604f7ea | Rust | 353 | 16 | use async_trait::async_trait;
use dbt_common::FsResult;
#[async_trait]
pub trait LicenseFetcher: Send + Sync {
async fn fetch_and_cache_license(&self) -> FsResult<()>;
}
pub struct NoOpLicenseFetcher;
#[async_trait]
impl LicenseFetcher for NoOpLicenseFetcher {
async fn fetch_and_cache_license(&self) -> FsRes... |
e59b7015e196826e1d89ab83a42772ab72bf327947241d7fdebedcff5a91e217 | Rust | 369 | 11 | use crate::credential::OAuthSession;
use serde::{Deserialize, Serialize};
/// On-disk cache persisted to `~/.dbt/oauth_sessions.json`.
///
/// Modeled as a `Vec` to support multi-account; a single active session is used for MVP.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OAuthSessionCache {
pub ver... |
974f533420b0bf1531f87ca1dd91e691cfda282b7669f9119eeb13866ed5a52d | Rust | 374 | 16 | use similar_asserts::assert_eq;
use minijinja::{args, Environment, State};
#[test]
fn test_basics() {
fn test(_: &State, a: u32, b: u32) -> bool {
assert_eq!(a, 23);
a == b
}
let mut env = Environment::new();
env.add_test("test", test);
let state = env.empty_state();
assert!(s... |
3d547a01d1617d1185d357276c67e40a1d80f2dc6d5d6a609790358880d69eb8 | Rust | 377 | 14 | use std::time::SystemTime;
pub fn current_time_micros() -> u128 {
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.expect("SystemTime before UNIX EPOCH!")
.as_micros()
}
pub fn time_micros(time: SystemTime) -> u128 {
time.duration_since(SystemTime::UNIX_EPOCH)
.expect... |
e199d2d71cd289725004c3252eecdf05ba3d5218506e360d131751053d2787c8 | Rust | 390 | 14 | use minijinja::{context, path_loader, Environment};
use once_cell::sync::Lazy;
static ENV: Lazy<Environment<'static>> = Lazy::new(|| {
let mut env = Environment::new();
env.set_loader(path_loader("templates"));
env
});
fn main() {
let tmpl = ENV.get_template("hello.txt").unwrap();
let ctx = contex... |
5c9dfd465f3a8449042bc85dfb572afeeaa11db959bd9efc24bdb7870fcc30f1 | Rust | 395 | 15 | #![allow(clippy::cognitive_complexity)]
#![allow(clippy::collapsible_if)]
#![allow(clippy::if_same_then_else)]
#![allow(clippy::let_and_return)]
#![allow(clippy::needless_bool)]
#![allow(clippy::only_used_in_recursion)]
#![allow(clippy::should_implement_trait)]
pub mod ident;
pub mod statements;
pub mod tokenizer;
pub... |
d10c75a7638e1d2e834a84573f105a21e9867025d42b5a49c4b221577119973e | Rust | 420 | 19 | use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Default)]
#[serde(rename_all = "snake_case")]
pub enum InputKind {
#[default]
Code,
Config,
Macro,
Seed,
Doc,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
pub struc... |
e6197c32b3a76af7ac32ca7c8c784897d56e33d93641ef9d65adb9c362687c0e | Rust | 420 | 17 | use minijinja::{context, Environment};
fn main() {
let mut env = Environment::new();
env.add_template("demo.txt", include_str!("demo.txt"))
.unwrap();
let template = env.get_template("demo.txt").unwrap();
println!(
"{}",
template
.render(context! {
na... |
a8fc4013697bb74420e88f702ece4fb9020e4c0ef18661c06c5ee1ee4dd8cca4 | Rust | 421 | 13 | //! This module contains everything related to configuring the Jinja environment for the parse phase.
mod resolve_context;
mod resolve_model_context;
pub mod init;
pub mod sql_resource;
pub use crate::utils::render_extract_ref_or_source_expr;
pub use resolve_context::{
build_docs_jinja_environment, build_docs_re... |
e4ac4d197952e94fc24bcc75e9bb20d3ac85edf05849a211dda36bab28c49fcf | Rust | 424 | 13 | use minijinja::value::Value;
use minijinja::{Environment, State};
#[test]
fn test_state_lookup_global() {
let mut env = Environment::new();
env.add_function("lookup_global", |state: &State| -> Value {
state.lookup("the_global", &[]).unwrap_or_default()
});
env.add_global("the_global", true);
... |
03a64e917351728b9884f244c0799b4674d3b309f902cfe6883d844a8c7b2598 | Rust | 425 | 18 | use std::path::Path;
use uuid::Uuid;
/// Emit discrete events during dbt execution.
pub trait DiscreteEventEmitter: Send + Sync {
fn configure(&mut self, send_anonymous_usage_stats: bool);
fn dbt_distribution(&self) -> &'static str;
fn invocation_start_event(
&self,
invocation_id: &Uuid,... |
527a614737f6bdea5835f942d60af824f2ca1331aa314c0d641ad4a385ac23f8 | Rust | 436 | 10 | //! Provider bundle for the docs server.
pub use dbt_docs_core::{
DefaultDistInfoProvider, DistInfo, DistInfoProvider, Providers, TelemetryHydration,
};
pub use dbt_index_core::{
Backend, BackendError, ColumnImpactArgs, ColumnImpactNode, ColumnImpactProvider,
ColumnLineageArgs, ColumnLineageEdge, ColumnLin... |
fdefb95b62e30f9019b3609cb212e68fc2937098f1e2177dad59047fc27a13d8 | Rust | 452 | 16 | use minijinja::{context, Environment};
fn main() {
let mut env = Environment::new();
env.add_template("macros.html", include_str!("macros.html"))
.unwrap();
env.add_template("template.html", include_str!("template.html"))
.unwrap();
let template = env.get_template("template.html").unwr... |
6b438d661fe38280f988af66667138bf8673813920c5c3585491966b562ba368 | Rust | 469 | 15 | use dbt_schemas::state::ResolverState;
/// Extracts the configured execution timezone (if any) from the resolver
/// state's profile.
pub fn profile_execution_time_zone(resolver_state: &ResolverState) -> Option<String> {
resolver_state
.dbt_profile
.default_db_config()
.to_mapping()
... |
fa35a10850ed2a41525a84818d2987a3b3c64ac0d2475c73d17d62df1fe9ae0a | Rust | 473 | 24 | use std::collections::BTreeMap;
use minijinja::Value;
use minijinja::value::mutable_vec::MutableVec;
pub fn none_value() -> Value {
Value::from(())
}
pub fn empty_string_value() -> Value {
Value::from("")
}
pub fn empty_vec_value() -> Value {
Value::from(Vec::<Value>::new())
}
pub fn empty_mutable_vec_... |
ec429a51f019f48c7be671800c545a3f1a5f9b67adbd11d20217608c5fa5a529 | Rust | 481 | 13 | use crate::model::network::Network;
/// Inject new observations into an input node
pub fn observation_update(network: &mut Network, node_idx: usize, observations: f64) {
network.attributes.states[node_idx].mean = observations;
}
/// Set observation values on bottom-layer (target) nodes.
pub fn set_observation(net... |
4dede29b196b6ceb8d23147e4307553313ac9a57c747efa20f85005817857b66 | Rust | 485 | 13 | mod compute_package_lock;
mod install_packages;
mod install_skills;
mod load_dbt_packages;
mod load_package_lock;
pub(super) use compute_package_lock::compute_package_lock;
pub(super) use install_packages::install_packages;
pub(super) use install_skills::{SkillInstallInputs, install_skills};
pub(crate) use load_dbt_pa... |
ffa584fc4c8904e21af7f537f685db0bdc60cf48414362a6df642bedb5112a7c | Rust | 508 | 12 | //! The vectorised deep-network backend: columnar layer types ([`layer`]),
//! matrix primitives ([`mat`]), the whole-network sweep driver ([`network`]),
//! and the weight optimisers ([`optimiser`]). The per-layer update kernels
//! live in [`crate::updates::vectorised`], mirroring the JAX package split
//! (`pyhgf/ty... |
fea3d4e703025d0e88a56d1dff54ef6c43ace52843fe2d71b847569d3b4d2ad9 | Rust | 515 | 13 | pub mod ingest_state;
pub mod metadata_to_parquet;
pub mod payload;
pub mod timings;
pub use metadata_to_parquet::{apply_delta_direct, ingest_from_metadata_direct};
pub use ingest_state::{
CATALOG_COLUMNS_SUBDIR, COMPILE_CLL_SUBDIR, COMPILE_COLUMNS_SUBDIR, COMPILE_NODES_SUBDIR,
IngestState, PARSE_ALIVE, PARSE... |
635e9023979b7f3a21ff191e788b6887d4505748f19b78e91c5ee810122e28f3 | Rust | 519 | 18 | use std::sync::Arc;
use dbt_loader::loader_hooks::{LoaderHooks, NoOpLoaderHooks};
use fs_deps::private_package::{LocalPrivatePackageResolver, PrivatePackageResolver};
pub struct LoaderFeature {
pub hooks: Arc<dyn LoaderHooks>,
pub private_package_resolver: Arc<dyn PrivatePackageResolver>,
}
impl Default for ... |
4a348408ec114181037979927352899cb824f3aac535ee617106f553a1ed4dc1 | Rust | 527 | 22 | #[allow(clippy::too_many_arguments)]
/// Feature definitions and the [FeatureStack](feature_stack::FeatureStack) struct.
pub mod feature_stack;
/// Builder for constructing a [FeatureStack](feature_stack::FeatureStack).
pub mod feature_stack_builder;
// All features:
pub mod adapter;
pub mod antlr_parser;
pub mod cli... |
b2a8649f083a6c2303c1b962a2795e8a87e4d6dc583f12346155e1d72658007e | Rust | 531 | 14 | use dbt_tracing::SeverityNumber;
/// Format severity level as fixed-width bracketed string: [info ], [warn ], [error], etc.
pub fn format_severity_fixed_width(severity: SeverityNumber) -> String {
let level_str = match severity {
SeverityNumber::Error => "error",
SeverityNumber::Warn => "warn ",
... |
2060031f59c64ba3e263290fc7a8eaa17ce2b95d0d679116b650a64e660d47ba | Rust | 533 | 15 | use reqwest::Client;
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
use reqwest_retry::{
RetryTransientMiddleware, policies::ExponentialBackoff as RetryExponentialBackoff,
};
const MAX_CLIENT_RETRIES: u32 = 3;
pub(crate) fn retrying_http_client() -> ClientWithMiddleware {
let retry_policy =
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.