Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/databrickslabs/dbldatagen
/ functions
Functions
902 in github.com/databrickslabs/dbldatagen
⨍
Functions
902
◇
Types & classes
96
↳
Endpoints
9
↓ 1,066 callers
Method
withColumn
add a new column to the synthetic data generation specification :param colName: Name of column to add. If this conflicts with the underlying
dbldatagen/data_generator.py:788
↓ 285 callers
Method
build
build the test data set from the column definitions and return a dataframe for it if `withStreaming` is True, generates a streaming data set
dbldatagen/data_generator.py:1329
↓ 162 callers
Method
withIdOutput
output seed column field (defaults to `id`) as a column in the generated data set if specified If this is not called, the seed column field
dbldatagen/data_generator.py:426
↓ 100 callers
Method
withColumnSpec
add a column specification for an existing column :returns: modified in-place instance of test data generator allowing for chaining of calls
dbldatagen/data_generator.py:728
↓ 72 callers
Method
get
Get a table generator from the dataset provider These are DataGenerator instances that can be used to generate the data. The dataset
dbldatagen/datasets_object.py:204
↓ 58 callers
Method
getColumnSpec
get column spec for column having name supplied :param name: name of column to find spec for :return: column spec for named column i
dbldatagen/data_generator.py:583
↓ 39 callers
Method
withSchema
populate column definitions and specifications for each of the columns in the schema :param sch: Spark SQL schema, from which fields are add
dbldatagen/data_generator.py:612
↓ 37 callers
Method
getLocalInstance
Create a machine local Spark instance for Datalib. By default, it uses `n-1` cores of the available cores for the spark session, wher
dbldatagen/spark_singleton.py:30
↓ 31 callers
Function
ensure
ensure(cond, s) => throws Exception(s) if c is not true :param cond: condition to test :param msg: Message to add to exception if exception i
dbldatagen/utils.py:76
↓ 29 callers
Method
builtBefore
check if field1 is built before field2
tests/test_build_planning.py:254
↓ 26 callers
Method
clone
Make a clone of the data spec via deep copy preserving same spark session :returns: deep copy of test data generator definition
dbldatagen/data_generator.py:312
↓ 25 callers
Method
builtInSeparatePhase
check if field1 is built in separate phase to field2
tests/test_build_planning.py:267
↓ 24 callers
Method
max
get the `max` attribute
dbldatagen/datarange.py:47
↓ 22 callers
Method
getOutputColumnNames
get list of output columns by flattening list of lists of column names normal columns will have a single column name but column definitio
dbldatagen/data_generator.py:592
↓ 21 callers
Method
getFieldType
(schema, fieldName)
tests/test_complex_columns.py:26
↓ 21 callers
Method
min
get the `min` attribute
dbldatagen/datarange.py:42
↓ 20 callers
Method
weights_as_percentages
(cls, w)
tests/test_weights.py:43
↓ 19 callers
Method
mkBasicDataspec
(cls, withRandom=False, dist=None, randomSeed=None)
tests/test_repeatable_data.py:22
↓ 18 callers
Method
explain
Explain the test data generation process :param suppressOutput: If True, suppress display of build plan :returns: String containing e
dbldatagen/data_generator.py:358
↓ 16 callers
Method
withStructColumn
Add a struct column to the synthetic data generation specification. This will add a new column composed of a struct of the specified
dbldatagen/data_generator.py:930
↓ 15 callers
Method
withConstraint
Add a constraint to control the data generation :param constraint: a constraint object to apply to the data generation :returns: refe
dbldatagen/data_generator.py:1209
↓ 15 callers
Method
withRandomSeed
Set the random seed for the text generator :param seed: seed value to set :return: self
dbldatagen/text_generators.py:82
↓ 14 callers
Method
checkTablesEqual
(self, df1, df2)
tests/test_repeatable_data.py:55
↓ 14 callers
Method
expr
get the `expr` attributed used to generate values for this column
dbldatagen/column_generation_spec.py:785
↓ 14 callers
Method
getDatasetDefinition
Get the dataset definition for the class
dbldatagen/datasets/dataset_provider.py:102
↓ 12 callers
Method
option
set option to option value for later processing :param optionKey: key for option :param optionValue: value for option :retur
dbldatagen/data_generator.py:439
↓ 11 callers
Method
_valueFromSummary
Get value from data summary :param dataSummary: Data summary to search, optional :param colName: Column name of column to get value
dbldatagen/data_analyzer.py:265
↓ 10 callers
Method
assertPercentagesEqual
(self, percentages, desired_percentages, target_delta=0.2)
tests/test_weights.py:69
↓ 9 callers
Method
_addMeasureToSummary
Add a measure to the summary dataframe :param measureName: Name of measure :param summaryExpr: Summary expression :param fie
dbldatagen/data_analyzer.py:95
↓ 9 callers
Method
autoComputePartitions
Compute the number of partitions based on rows and columns :param rows: number of rows :param columns: number of columns :re
dbldatagen/datasets/dataset_provider.py:263
↓ 9 callers
Function
coalesce_values
For a supplied list of arguments, returns the first argument that does not have the value `None` :param args: variable list of arguments which ar
dbldatagen/utils.py:64
↓ 9 callers
Method
getRegisteredDatasets
Get the registered dataset definitions :return: A dictionary of registered datasets metadata objects
dbldatagen/datasets/dataset_provider.py:167
↓ 9 callers
Method
get_observed_weights
(cls, df, column, values)
tests/test_weights.py:50
↓ 9 callers
Method
withConstraints
Add a constraint to control the data generation :param constraints: a list of constraint objects to apply to the data generation :ret
dbldatagen/data_generator.py:1225
↓ 8 callers
Method
computeBuildPlan
prepare for building by computing a pseudo build plan The build plan is not a true build plan - it is only used for debugging purposes, but
dbldatagen/data_generator.py:1258
↓ 8 callers
Method
getDiscreteRange
Convert range to discrete range :returns: number of discrete values in range. For example `NRange(1, 5, 0.5)` has 8 discrete values
dbldatagen/nrange.py:109
↓ 8 callers
Method
mkCombinedConstraintExpression
Generate a SQL expression that combines multiple constraints using AND :param constraintExpressions: list of Pyspark SQL Column constraint e
dbldatagen/constraints/constraint.py:67
↓ 8 callers
Method
withRowCount
Modify the row count - useful when starting a new spec from a clone :param rc: The count of rows to generate :returns: modified in-pl
dbldatagen/data_generator.py:392
↓ 7 callers
Method
_columnsFromListOrString
Get columns as list of columns from string of list-like :param columns: string or list of strings representing column names
dbldatagen/constraints/constraint.py:30
↓ 7 callers
Method
getDatasetTables
Get the dataset tables list for the class
dbldatagen/datasets/dataset_provider.py:107
↓ 7 callers
Method
getNPRandomGenerator
Get numpy random number generator :return: returns random number generator initialized from previously supplied random seed
dbldatagen/text_generators.py:97
↓ 7 callers
Method
keys
Get the keys as list of strings
dbldatagen/column_generation_spec.py:718
↓ 7 callers
Method
registerDataset
Register the dataset provider type using metadata defined in the dataset provider :param datasetProvider: Dataset provider class :re
dbldatagen/datasets/dataset_provider.py:117
↓ 7 callers
Method
withColumnSpecs
Add column specs for columns matching a) list of field names, b) one or more regex patterns c) type (as in pyspark.sq
dbldatagen/data_generator.py:640
↓ 6 callers
Method
_prepare_random_bounds
Prepare the random bounds for processing of the template expansion For each template, we will have a vector of random numbers to gen
dbldatagen/text_generators.py:564
↓ 6 callers
Method
columnTypeFromString
Generate a Spark SQL data type from a string Allowable options for `type_string` parameter are: * `string`, `varchar`, `char`, `nva
dbldatagen/schema_parser.py:222
↓ 6 callers
Method
describe
This method lists the registered datasets It filters the list by a regular expression pattern if provided :param name: name o
dbldatagen/datasets_object.py:102
↓ 6 callers
Method
getInferredColumnNames
get list of output columns
dbldatagen/data_generator.py:571
↓ 6 callers
Method
getOrElse
Get val for key if it exists or else return default
dbldatagen/column_spec_options.py:213
↓ 6 callers
Method
get_np_random_generator
Get numpy random number generator :param random_seed: Numeric random seed to use. If < 0, then no random :return:
dbldatagen/distributions/data_distribution.py:37
↓ 6 callers
Method
pandasGenerateText
entry point to use for pandas udfs Implementation uses vectorized implementation of process :param v: Pandas series of values passe
dbldatagen/text_generators.py:609
↓ 6 callers
Method
roundIfNotNull
(x, scale)
tests/test_ranged_values_and_dates.py:842
↓ 6 callers
Function
strip_margins
Python equivalent of Scala stripMargins method Takes a string (potentially multiline) and strips all chars up and including the first oc
dbldatagen/utils.py:241
↓ 6 callers
Method
withInit
Specifies context initialization function :param fn: function pointer or lambda function for initialization signa
dbldatagen/text_generator_plugins.py:197
↓ 5 callers
Method
getNames
get column names as list of strings
dbldatagen/column_generation_spec.py:700
↓ 5 callers
Method
getRegisteredDatasetsVersion
Get the registered datasets version indicator :return: A dictionary of registered datasets
dbldatagen/datasets/dataset_provider.py:175
↓ 5 callers
Method
parseCreateTable
Parse a schema from a schema string :param sparkSession: spark session to use :param source_schema: should be a table defini
dbldatagen/schema_parser.py:327
↓ 5 callers
Method
scriptTable
generate create table script suitable for format of test data set :param name: name of table to use in generated script :param locat
dbldatagen/data_generator.py:1452
↓ 5 callers
Method
withRootProperty
If called, specifies the property of the context to be passed to the text generation function. If not called, the context object itself w
dbldatagen/text_generator_plugins.py:225
↓ 5 callers
Function
writeUnderlined
write underlined text in RST markup format :param outputFile: output file to write to :param text: text to write :param underline: char
docs/utils/mk_quick_index.py:110
↓ 4 callers
Method
_checkSparkVersion
check spark version :param sparkVersion: spark version string :param minSparkVersion: min spark version as tuple :ret
dbldatagen/data_generator.py:182
↓ 4 callers
Method
_getDateTime
(cls, dt, datetime_format, default_value)
dbldatagen/daterange.py:74
↓ 4 callers
Method
_getDefaultSparkParallelism
Get the default parallelism for a spark session, if spark session supports getting the sparkContext :param sparkSession: spark session
dbldatagen/data_generator.py:259
↓ 4 callers
Method
_getMultiColumnDetails
Determine min and max number of columns to generate along with `structType` for columns with multiple columns / features :param
dbldatagen/column_generation_spec.py:1217
↓ 4 callers
Method
_getRandomInt
generate random integer between low and high inclusive :param low: low value, if no high value is specified, treat low value as high value a
dbldatagen/text_generators.py:318
↓ 4 callers
Method
_getSeedExpression
Get seed expression for column generation This is used to generate the base value for every column if using a single base column, th
dbldatagen/column_generation_spec.py:908
↓ 4 callers
Method
_markForPlanRegen
Mark that build plan needs to be regenerated :returns: modified in-place instance of test data generator allowing for chaining of calls follo
dbldatagen/data_generator.py:349
↓ 4 callers
Method
clear
(self)
tests/test_options.py:20
↓ 4 callers
Method
flatten
flatten list :param lst: list to flatten
dbldatagen/data_generator.py:576
↓ 4 callers
Method
isValidDataProviderType
Check if object is a valid data provider type :param candidateDataProvider: potential Dataset provider class :return: True if valid D
dbldatagen/datasets/dataset_provider.py:90
↓ 4 callers
Function
processDirectory
process directory for package or subpackage :param outputFile: output file instance :param pathToProcess: path to process :param subpack
docs/utils/mk_quick_index.py:242
↓ 4 callers
Function
python_version_check
Check against Python version Allows minimum version to be passed in to facilitate unit testing :param python_version_expected: = minim
dbldatagen/__init__.py:56
↓ 4 callers
Method
summarizeToDF
Generate summary analysis of data set as dataframe :return: Summary results as dataframe The resulting dataframe can be displayed w
dbldatagen/data_analyzer.py:148
↓ 3 callers
Method
_datetime_from_string
convert string to Python DateTime object using format
dbldatagen/daterange.py:58
↓ 3 callers
Method
_get
(self, *, providerName, tableName, rows=-1, partitions=-1, **kwargs)
dbldatagen/datasets_object.py:187
↓ 3 callers
Function
_get_spark_version
(sparkVersion)
dbldatagen/_version.py:41
↓ 3 callers
Method
_precision_and_scale
(self, x)
dbldatagen/nrange.py:148
↓ 3 callers
Method
_setup_logger
Set up logging This will set the logger at warning, info or debug levels depending on the instance construction parameters
dbldatagen/column_generation_spec.py:503
↓ 3 callers
Method
_temporaryRename
Create enter / exit object to support temporary renaming of column spec This is to support the functionality: ``` with c
dbldatagen/column_generation_spec.py:302
↓ 3 callers
Method
checkBoolOption
Check that option is either not specified or of type boolean :param v: value to test :param name: name of value to use in any report
dbldatagen/column_spec_options.py:228
↓ 3 callers
Method
compactNumpyTypeForValues
determine smallest numpy type to represent values :param listValues: list or np.ndarray of values to get np.dtype for :return: np.dt
dbldatagen/text_generators.py:119
↓ 3 callers
Method
find
(self, attributePath)
dbldatagen/datasets_object.py:373
↓ 3 callers
Method
formatCodeAsHtml
Formats supplied code as Html suitable for use with notebook ``displayHTML`` :param codeText: Code to be wrapped in html section :re
dbldatagen/html_utils.py:21
↓ 3 callers
Method
generateName
get a name for the data set Uses the untitled name prefix and nextNameIndex to generate a dummy dataset name :returns: stri
dbldatagen/data_generator.py:300
↓ 3 callers
Method
generateText
generate text for seed based on configuration parameters. As it uses numpy, repeatability is restricted depending on version of the
dbldatagen/text_generators.py:749
↓ 3 callers
Method
getAsTupleOrElse
get value v as tuple or return default value :param v: value to test :param defaultValue: value to use as a default if value
dbldatagen/text_generators.py:141
↓ 3 callers
Method
getColumnType
Get column Spark SQL datatype for specified column :param colName: name of column as string :returns: Spark SQL datatype for named c
dbldatagen/data_generator.py:551
↓ 3 callers
Method
getFields
(self, df)
tests/test_repeatable_data.py:45
↓ 3 callers
Method
getProviderDefinitions
Get provider definitions for one or more datasets :param name: name of dataset to get provider for, if None, returns all providers :p
dbldatagen/datasets_object.py:49
↓ 3 callers
Method
getScale
Get scale of range
dbldatagen/nrange.py:134
↓ 3 callers
Method
get_log_capture_warngings_and_errors
gets count of errors containing specified text :param caplog_object: log capture object from fixture :param searchText: text
tests/test_basic_test.py:56
↓ 3 callers
Method
isFullyPopulated
Check is all instance vars are populated :returns: `True` if fully populated, `False` otherwise
dbldatagen/nrange.py:73
↓ 3 callers
Function
parse_time_interval
parse time interval from string
dbldatagen/utils.py:179
↓ 3 callers
Function
processItemList
process list of items :param outputFile: output file instance :param items: list of items. each item is a tuple of ( "moduleName.typename",
docs/utils/mk_quick_index.py:217
↓ 3 callers
Method
scriptMerge
generate merge table script suitable for format of test data set :param tgtName: name of target table to use in generated script :pa
dbldatagen/data_generator.py:1492
↓ 3 callers
Method
setup_log_capture
set up log capture fixture Sets up log capture fixture to only capture messages after setup and only capture warnings and errors
tests/test_basic_test.py:44
↓ 3 callers
Method
summarize
Generate summary analysis of data set and return / print summary results :param suppressOutput: If False, prints results to console also
dbldatagen/data_analyzer.py:241
↓ 3 callers
Function
system_time_millis
return system time as milliseconds since start of epoch :return: system time millis as long
dbldatagen/utils.py:354
↓ 2 callers
Method
_addEntry
(self, datasets, steps, providerName, tableName)
dbldatagen/datasets_object.py:344
↓ 2 callers
Method
_adjustForMinValue
Adjust for minimum value of data range :param baseval: base expression :param datarange: data range to conform to :param forc
dbldatagen/column_generation_spec.py:988
next →
1–100 of 902, ranked by callers