def read_yaml_file()

in clouddq-migration/dataplex.py [0:0]


def read_yaml_file(bucket_name, file_name) -> dict:
    '''
        Method to read the yaml file from the storage bucket
    '''
    # Initialize a client
    client = storage.Client()

    # Get the bucket
    bucket = client.get_bucket(bucket_name)

    # Get the blob (file)
    blob = bucket.blob(file_name)

    # Download the contents of the file
    content = blob.download_as_string()
    yaml_data = yaml.safe_load(content)

    return yaml_data