Import data from a Parquet file and return with rows.Table.

def import_from_parquet(filename_or_fobj, *args, **kwargs):
    """Import data from a Parquet file and return with rows.Table."""
    source = Source.from_file(filename_or_fobj, plugin_name="parquet", mode="rb")

    # TODO: should look into `schema.converted_type` also
    types = OrderedDict(
        [
            (schema.name, PARQUET_TO_ROWS[schema.type])
            for schema in parquet._read_footer(source.fobj).schema
            if schema.type is not None
        ]
    )
    header = list(types.keys())
    table_rows = list(parquet.reader(source.fobj))  # TODO: be lazy

    meta = {"imported_from": "parquet", "source": source}
    return create_table(
        [header] + table_rows, meta=meta, force_types=types, *args, **kwargs
    )