def export_glossary_entries_json()

in dataplex-quickstart-labs/00-resources/scripts/python/business-glossary-import/bg_import/business_glossary_export_v2.py [0:0]


def export_glossary_entries_json(entries: List[Dict[str, Any]],
                                 output_json: str,
                                 parent_mapping: Dict[str, str],
                                 map_entry_id_to_entry_type: Dict[str, str],
                                 max_workers: int = MAX_WORKERS):
    """
    Process each entry and write the export JSON as one object per line.
    """
    with open(output_json, mode="w", encoding="utf-8") as outputfile:
        with ThreadPoolExecutor(max_workers=max_workers) as executor:
            futures = []
            for e in entries:
                futures.append(
                    executor.submit(
                        process_entry,
                        e,
                        parent_mapping,
                        map_entry_id_to_entry_type,
                    )
                )
            for future in as_completed(futures):
                result = future.result()
                if result:
                    outputfile.write(json.dumps(result) + "\n")