code: def test_csv_read_partitioned_with_filter(
      ray_start_regular_shared,
      fs,
      data_path,
      endpoint_url,
      write_base_partitioned_df,
      assert_base_partitioned_ds,
  ):
      storage_options = (
          {}
          if endpoint_url is None
          else dict(client_kwargs=dict(endpoint_url=endpoint_url))
      )
      partition_keys = ["one"]
      file_writer_fn = partial(
          df_to_csv, storage_options=storage_options, index=False
      )
      kept_file_counter = Counter.remote()
      skipped_file_counter = Counter.remote()
  
      def skip_unpartitioned(kv_dict):
          keep = bool(kv_dict)
          counter = kept_file_counter if keep else skipped_file_counter
          ray.get(counter.increment.remote())
          return keep
  
      for style in [PartitionStyle.HIVE, PartitionStyle.DIRECTORY]:
          base_dir = os.path.join(data_path, style.value)
          partition_path_encoder = PathPartitionEncoder.of(
              style=style,
              base_dir=base_dir,
              field_names=partition_keys,
              filesystem=fs,
          )
          write_base_partitioned_df(
              partition_keys,
              partition_path_encoder,
              file_writer_fn,
          )
          file_writer_fn(
              pd.DataFrame({"1": [1]}),
              os.path.join(base_dir, "test.csv"),
          )
          partition_path_filter = PathPartitionFilter.of(
              style=style,
              base_dir=base_dir,
              field_names=partition_keys,
              filesystem=fs,
              filter_fn=skip_unpartitioned,
          )
          ds = ray.data.read_csv(
              base_dir,
              partition_filter=partition_path_filter,
              filesystem=fs,
          )
          assert_base_partitioned_ds(ds)
          assert ray.get(kept_file_counter.get.remote()) == 2
          assert ray.get(skipped_file_counter.get.remote()) == 1
          ray.get(kept_file_counter.reset.remote())
          ray.get(skipped_file_counter.reset.remote())
  
imports: import itertools
  import os
  import shutil
  from functools import partial
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  from packaging.version import Version
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.block import BlockAccessor
  from ray.data.datasource import BaseFileMetadataProvider, FastFileMetadataProvider, PartitionStyle, PathPartitionFilter
  from ray.data.datasource.file_based_datasource import FILE_SIZE_FETCH_PARALLELIZATION_THRESHOLD
  from ray.data.datasource.path_util import _unwrap_protocol
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.test_partitioning import PathPartitionEncoder
  from ray.data.tests.util import Counter
  from ray.tests.conftest import *
label_desc: Use image node_id 11 for calling a global function with example usage: test_csv_read_partitioned_with_filter(ray_start_regular_shared, fs, data_path, endpoint_url, write_base_partitioned_df, assert_base_partitioned_ds) and returns: keep