Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18125 )

Change subject: IMPALA-11070: Create TestSection class.
......................................................................


Patch Set 4:

There are two approaches that I would prefer to a custom class with custom 
functions.

1. The parse_test_file_text() function reads a test file and produces a 
dictionary. One reasonable way to handle different configurations is for this 
function to produce a different dictionary. If there a "FOO" configuration that 
should prefer "FOO_*" fields (e.g. FOO_TYPES vs TYPES), then this function 
would return a dictionary with "TYPES" set to the value of "FOO_TYPES" in the 
FOO configuration. Since it continues to be a dictionary, the rest of the code 
wouldn't need to change.

2. In Python, you can create a class that implements the container interface 
and can be used in place of a dictionary. Another reasonable way to handle the 
different configurations is to have a class that wraps a dictionary and knows 
to prefer FOO fields to non-FOO versions (and implements the container 
interface). Since it implements the container interface, the rest of the code 
wouldn't need to change.

Is there something about having a custom class with custom functions that you 
need for the use-case you have in mind?


--
To view, visit http://gerrit.cloudera.org:8080/18125
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3fed7ef64ac263b49b5b6e4a237a296092e4dcb8
Gerrit-Change-Number: 18125
Gerrit-PatchSet: 4
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Comment-Date: Thu, 13 Jan 2022 00:05:09 +0000
Gerrit-HasComments: No

Reply via email to