pitrou commented on code in PR #39340:
URL: https://github.com/apache/arrow/pull/39340#discussion_r1434225879


##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -338,6 +338,16 @@ culpa qui officia deserunt mollit anim id est laborum.
   }
 };
 
+// A class that exists only to expose
+// AzureFileSystem::ForceCachedHierarchicalNamespaceSupport to unit tests.

Review Comment:
   Or you can use a `friend TestAzureFileSystem` declaration in 
`AzureFileSystem` for less hackery.



##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -348,14 +358,25 @@ class TestAzureFileSystem : public ::testing::Test {
   bool set_up_succeeded_ = false;
   AzureOptions options_;
 
-  std::shared_ptr<FileSystem> fs_;
+  std::shared_ptr<FileSystem> fs_dont_use_directly_;  // use fs()
   std::unique_ptr<Blobs::BlobServiceClient> blob_service_client_;
   std::unique_ptr<DataLake::DataLakeServiceClient> datalake_service_client_;
 
  public:
   TestAzureFileSystem() : rng_(std::random_device()()) {}
 
   virtual Result<BaseAzureEnv*> GetAzureEnv() const = 0;
+  virtual HNSSupport CachedHNSSupport(const BaseAzureEnv& env) const = 0;
+
+  FileSystem* fs(HNSSupport cached_hns_support) const {
+    return static_cast<AzureFileSystemForTesting*>(fs_dont_use_directly_.get())

Review Comment:
   Use `checked_cast` instead?



##########
cpp/src/arrow/filesystem/azurefs.h:
##########
@@ -154,6 +154,9 @@ class ARROW_EXPORT AzureFileSystem : public FileSystem {
 
   explicit AzureFileSystem(std::unique_ptr<Impl>&& impl);
 
+ protected:
+  AzureFileSystem* ForceCachedHierarchicalNamespaceSupport(int hns_support);

Review Comment:
   I'm not sure why this is returning a `AzureFileSystem*`. This is not an 
idiom we use in general.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to