def _get_main_table_shape(metadata: dict) -> dict:
    """Reads into a CBS dataset metadata and returns the main table's shape as a dict.

    - For v3 odata, n_records and n_columns exist in the metadata
    - For v4 odata, n_observations exist in the metadata.

    This function returns a dict with all 3 keys, and sets non-existing values as None.

    Parameters
    ----------
    metadata : dict
        The dataset's metadata

    Returns
    -------
    dict
        The dataset's main table's shape
    """
    main_table_shape = {
        "n_records": metadata.get("RecordCount"),
        "n_columns": metadata.get("ColumnCount"),
        "n_observations": metadata.get("ObservationCount"),
    }
    return main_table_shape