code: def test_create_metadata_file_inconsistent_schema(tmpdir):
      # NOTE: This test demonstrates that the CudfEngine
      # can be used to generate a global `_metadata` file
      # even if there are inconsistent schemas in the dataset.
  
      # Write file 0
      df0 = pd.DataFrame({"a": [None] * 10, "b": range(10)})
      p0 = os.path.join(tmpdir, "part.0.parquet")
      df0.to_parquet(p0, engine="pyarrow")
  
      # Write file 1
      b = list(range(10))
      b[1] = None
      df1 = pd.DataFrame({"a": range(10), "b": b})
      p1 = os.path.join(tmpdir, "part.1.parquet")
      df1.to_parquet(p1, engine="pyarrow")
  
      # New pyarrow-dataset base can handle an inconsistent
      # schema (even without a _metadata file), but computing
      # and dtype validation may fail
      ddf1 = dask_cudf.read_parquet(
          str(tmpdir), calculate_divisions=True
      )
  
      # Add global metadata file.
      # Dask-CuDF can do this without requiring schema
      # consistency.
      dask_cudf.io.parquet.create_metadata_file([p0, p1])
  
      # Check that we can still read the ddf
      # with the _metadata file present
      ddf2 = dask_cudf.read_parquet(
          str(tmpdir), calculate_divisions=True
      )
  
      # Check that the result is the same with and
      # without the _metadata file.  Note that we must
      # call `compute` on `ddf1`, because the dtype of
      # the inconsistent column ("a") may be "object"
      # before computing, and "int" after
      dd.assert_eq(ddf1.compute(), ddf2)
      dd.assert_eq(ddf1.compute(), ddf2.compute())
  
imports: import glob
  import math
  import os
  import numpy
  import pandas
  import pytest
  import dask
  from dask import dataframe
  from dask.utils import natural_sort_key
  import cudf
  import dask_cudf
label_desc: Use image node_id 19 for calling a global function with example usage: test_create_metadata_file_inconsistent_schema(tmpdir) without return types