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


##########
table/rolling_data_writer.go:
##########
@@ -108,6 +108,7 @@ func withFactoryFileSchema(schema *iceberg.Schema) 
writerFactoryOption {
 // configuration derived from the table metadata.
 func newWriterFactory(rootLocation string, args recordWritingArgs, meta 
*MetadataBuilder, taskSchema *iceberg.Schema, targetFileSize int64, opts 
...writerFactoryOption) (*writerFactory, error) {
        nextCount, stopCount := iter.Pull(args.counter)
+       propCtx := tblutils.WithTableProperties(context.Background(), 
meta.props)

Review Comment:
   Minor: this builds the prop-context from `context.Background()` rather than 
a caller-supplied ctx, so a caller's cancellation/deadline won't propagate into 
the schema conversion done here. If a request ctx is reachable at this call 
site, threading it through would be more consistent with the other write paths 
in this PR.



##########
table/arrow_utils.go:
##########
@@ -528,6 +528,10 @@ func ensureSmallArrowTypes(dt arrow.DataType) 
(arrow.DataType, error) {
 }
 
 type convertToArrow struct {
+       // the ctx stores table property metadata,
+       // for instance, projjson definitions that can be
+       // used when writing
+       ctx             context.Context

Review Comment:
   Non-blocking: storing a `context.Context` in the `convertToArrow` struct is 
generally discouraged in Go (contexts should flow as function arguments) and 
may trip the `containedctx` linter. Since it's only read during `Visit`, 
passing it through the visit call rather than storing it on the struct would 
avoid the stored-context pattern.



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