misc#
Miscellaneous helper functions and classes.
Functions#
Returns a string distinct from given strings. |
|
Prints a spark dataframe in a deterministic way. |
|
Returns a deep copy of argument if it is mutable. |
|
Returns the fully qualified name of the given object. |
|
Escapes column name if it contains special characters. |
|
Returns a new DataFrame constructed after materializing. |
- get_nonconflicting_string(strs)#
Returns a string distinct from given strings.
- print_sdf(sdf)#
Prints a spark dataframe in a deterministic way.
- Parameters
sdf (pyspark.sql.DataFrame) –
- Return type
None
- copy_if_mutable(value)#
Returns a deep copy of argument if it is mutable.
- Parameters
value (T) –
- Return type
T
- get_fullname(obj)#
Returns the fully qualified name of the given object.
- Parameters
obj (Any) – Object to get the name of.
- Return type
- escape_column_name(column_name)#
Escapes column name if it contains special characters.
- get_materialized_df(sdf, table_name)#
Returns a new DataFrame constructed after materializing.
- Parameters
sdf (pyspark.sql.DataFrame) – DataFrame to be materialized.
table_name (str) – Name to be used to refer to the table. If a table with table_name already exists, an error is raised.
- Return type
Classes#
Mimics python random interface for discrete gaussian sampling. |
- class RNGWrapper(rng)#
Mimics python random interface for discrete gaussian sampling.
- Parameters
rng (numpy.random.Generator) –