zeroshade commented on code in PR #452:
URL: https://github.com/apache/iceberg-go/pull/452#discussion_r2129939523


##########
catalog/glue/glue.go:
##########
@@ -223,13 +223,15 @@ func (c *Catalog) LoadTable(ctx context.Context, 
identifier table.Identifier, pr
        }
 
        ctx = utils.WithAwsConfig(ctx, c.awsCfg)
-       // TODO: consider providing a way to directly access the S3 iofs to 
enable testing of the catalog.
-       iofs, err := io.LoadFS(ctx, props, location)
-       if err != nil {
-               return nil, fmt.Errorf("failed to load table %s.%s: %w", 
database, tableName, err)
-       }
 
-       icebergTable, err := table.NewFromLocation(identifier, location, iofs, 
c)
+       icebergTable, err := table.NewFromLocation(ctx, identifier, location, 
func(ctx context.Context) (io.IO, error) {
+               // TODO: consider providing a way to directly access the S3 
iofs to enable testing of the catalog.
+               iofs, err := io.LoadFS(ctx, props, location)
+               if err != nil {
+                       return nil, fmt.Errorf("failed to load table %s.%s: 
%w", database, tableName, err)
+               }
+               return iofs, nil
+       }, c)

Review Comment:
   if we're going to go with passing a function like this, instead of 
duplicating this everywhere, we should just expose a standard helper function 
which does exactly this that you can pass as the default



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to