MCPcopy Create free account

hub / github.com/databrickslabs/dbldatagen / functions

Functions902 in github.com/databrickslabs/dbldatagen

↓ 1,066 callersMethodwithColumn
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 callersMethodbuild
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 callersMethodwithIdOutput
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 callersMethodwithColumnSpec
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 callersMethodget
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 callersMethodgetColumnSpec
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 callersMethodwithSchema
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 callersMethodgetLocalInstance
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 callersFunctionensure
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 callersMethodbuiltBefore
check if field1 is built before field2
tests/test_build_planning.py:254
↓ 26 callersMethodclone
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 callersMethodbuiltInSeparatePhase
check if field1 is built in separate phase to field2
tests/test_build_planning.py:267
↓ 24 callersMethodmax
get the `max` attribute
dbldatagen/datarange.py:47
↓ 22 callersMethodgetOutputColumnNames
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 callersMethodgetFieldType
(schema, fieldName)
tests/test_complex_columns.py:26
↓ 21 callersMethodmin
get the `min` attribute
dbldatagen/datarange.py:42
↓ 20 callersMethodweights_as_percentages
(cls, w)
tests/test_weights.py:43
↓ 19 callersMethodmkBasicDataspec
(cls, withRandom=False, dist=None, randomSeed=None)
tests/test_repeatable_data.py:22
↓ 18 callersMethodexplain
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 callersMethodwithStructColumn
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 callersMethodwithConstraint
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 callersMethodwithRandomSeed
Set the random seed for the text generator :param seed: seed value to set :return: self
dbldatagen/text_generators.py:82
↓ 14 callersMethodcheckTablesEqual
(self, df1, df2)
tests/test_repeatable_data.py:55
↓ 14 callersMethodexpr
get the `expr` attributed used to generate values for this column
dbldatagen/column_generation_spec.py:785
↓ 14 callersMethodgetDatasetDefinition
Get the dataset definition for the class
dbldatagen/datasets/dataset_provider.py:102
↓ 12 callersMethodoption
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 callersMethod_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 callersMethodassertPercentagesEqual
(self, percentages, desired_percentages, target_delta=0.2)
tests/test_weights.py:69
↓ 9 callersMethod_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 callersMethodautoComputePartitions
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 callersFunctioncoalesce_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 callersMethodgetRegisteredDatasets
Get the registered dataset definitions :return: A dictionary of registered datasets metadata objects
dbldatagen/datasets/dataset_provider.py:167
↓ 9 callersMethodget_observed_weights
(cls, df, column, values)
tests/test_weights.py:50
↓ 9 callersMethodwithConstraints
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 callersMethodcomputeBuildPlan
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 callersMethodgetDiscreteRange
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 callersMethodmkCombinedConstraintExpression
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 callersMethodwithRowCount
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 callersMethod_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 callersMethodgetDatasetTables
Get the dataset tables list for the class
dbldatagen/datasets/dataset_provider.py:107
↓ 7 callersMethodgetNPRandomGenerator
Get numpy random number generator :return: returns random number generator initialized from previously supplied random seed
dbldatagen/text_generators.py:97
↓ 7 callersMethodkeys
Get the keys as list of strings
dbldatagen/column_generation_spec.py:718
↓ 7 callersMethodregisterDataset
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 callersMethodwithColumnSpecs
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 callersMethod_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 callersMethodcolumnTypeFromString
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 callersMethoddescribe
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 callersMethodgetInferredColumnNames
get list of output columns
dbldatagen/data_generator.py:571
↓ 6 callersMethodgetOrElse
Get val for key if it exists or else return default
dbldatagen/column_spec_options.py:213
↓ 6 callersMethodget_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 callersMethodpandasGenerateText
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 callersMethodroundIfNotNull
(x, scale)
tests/test_ranged_values_and_dates.py:842
↓ 6 callersFunctionstrip_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 callersMethodwithInit
Specifies context initialization function :param fn: function pointer or lambda function for initialization signa
dbldatagen/text_generator_plugins.py:197
↓ 5 callersMethodgetNames
get column names as list of strings
dbldatagen/column_generation_spec.py:700
↓ 5 callersMethodgetRegisteredDatasetsVersion
Get the registered datasets version indicator :return: A dictionary of registered datasets
dbldatagen/datasets/dataset_provider.py:175
↓ 5 callersMethodparseCreateTable
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 callersMethodscriptTable
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 callersMethodwithRootProperty
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 callersFunctionwriteUnderlined
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 callersMethod_checkSparkVersion
check spark version :param sparkVersion: spark version string :param minSparkVersion: min spark version as tuple :ret
dbldatagen/data_generator.py:182
↓ 4 callersMethod_getDateTime
(cls, dt, datetime_format, default_value)
dbldatagen/daterange.py:74
↓ 4 callersMethod_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 callersMethod_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 callersMethod_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 callersMethod_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 callersMethod_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 callersMethodclear
(self)
tests/test_options.py:20
↓ 4 callersMethodflatten
flatten list :param lst: list to flatten
dbldatagen/data_generator.py:576
↓ 4 callersMethodisValidDataProviderType
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 callersFunctionprocessDirectory
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 callersFunctionpython_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 callersMethodsummarizeToDF
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 callersMethod_datetime_from_string
convert string to Python DateTime object using format
dbldatagen/daterange.py:58
↓ 3 callersMethod_get
(self, *, providerName, tableName, rows=-1, partitions=-1, **kwargs)
dbldatagen/datasets_object.py:187
↓ 3 callersFunction_get_spark_version
(sparkVersion)
dbldatagen/_version.py:41
↓ 3 callersMethod_precision_and_scale
(self, x)
dbldatagen/nrange.py:148
↓ 3 callersMethod_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 callersMethod_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 callersMethodcheckBoolOption
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 callersMethodcompactNumpyTypeForValues
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 callersMethodfind
(self, attributePath)
dbldatagen/datasets_object.py:373
↓ 3 callersMethodformatCodeAsHtml
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 callersMethodgenerateName
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 callersMethodgenerateText
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 callersMethodgetAsTupleOrElse
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 callersMethodgetColumnType
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 callersMethodgetFields
(self, df)
tests/test_repeatable_data.py:45
↓ 3 callersMethodgetProviderDefinitions
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 callersMethodgetScale
Get scale of range
dbldatagen/nrange.py:134
↓ 3 callersMethodget_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 callersMethodisFullyPopulated
Check is all instance vars are populated :returns: `True` if fully populated, `False` otherwise
dbldatagen/nrange.py:73
↓ 3 callersFunctionparse_time_interval
parse time interval from string
dbldatagen/utils.py:179
↓ 3 callersFunctionprocessItemList
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 callersMethodscriptMerge
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 callersMethodsetup_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 callersMethodsummarize
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 callersFunctionsystem_time_millis
return system time as milliseconds since start of epoch :return: system time millis as long
dbldatagen/utils.py:354
↓ 2 callersMethod_addEntry
(self, datasets, steps, providerName, tableName)
dbldatagen/datasets_object.py:344
↓ 2 callersMethod_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