Skip to main content

easyfabric.loaders.xml

load_xml_bronze​

def load_xml_bronze(object_info: ObjectInfo,
table_config: TableConfig,
config_manager: ConfigManager = None) -> DataFrame

Load XML file into Bronze layer with support for nested XML structures

Arguments:

  • object_info - ObjectInfo containing the XML file path info
  • table_config - Table configuration object
  • config_manager - Configuration manager object

Returns:

DataFrame with columns renamed according to table_config

validate_xml_schema​

def validate_xml_schema(xml_file_path: str,
expected_schema: StructType) -> bool

Validate that the XML file matches the expected schema

Arguments:

  • xml_file_path - Path to the XML file
  • expected_schema - Expected schema as StructType

Returns:

  • bool - True if schema matches, False otherwise

read_xml_text​

def read_xml_text(spark, abfs_file_path: str) -> str

The current content of the file, read through Spark on its abfss path.

get_nested_data​

def get_nested_data(data_dict, path)

Follow path through the parsed XML; an empty element on the way holds no rows.