Open noidname01 opened 5 months ago
I’m interested in working on this issue.
I ran an initial pylint test. It looks like there are 20 issues to fix. I will submit them in batches.
Hi @ian910297, thanks for your interest in this issue. If you have any question, feel free to comment and let us know👍
@noidname01 I've outlined some scenarios, but I'd like to discuss them before writing the code.
reference: [SPARK-42342][PYTHON][CONNECT] Introduce base hierarchy to exceptions #39882
Unit and integration tests are allowed to have duplicate code in specific files.
audit_dto = AuditDTO(
_creator="test",
_create_time="2022-01-01T00:00:00Z",
_last_modifier="test",
_last_modified_time="2024-04-05T10:10:35.218Z",
)
no idea: how to refactor the getter function of private variables This code doesn't look very Pythonic. If we want to remove the duplication, we may need to rewrite it more systematically.
@dataclass
class SetProperty:
"""A fileset change to set the property and value for the fileset."""
_property: str = field(metadata=config(field_name="property"))
_value: str = field(metadata=config(field_name="value"))
def property(self):
"""Retrieves the name of the property being set in the fileset.
Returns:
The name of the property.
"""
return self._property
Hi @ian910297, thanks for your detailed descriptions.
About exception, actually I've created an issue recently to refactor current error handling(#4012). It seems that exception structure is related to many issues, like #3766, so maybe we can solve issue 4012 first? WDYT?
I don't really get what it means, can you give more context?
Yeah, I've also noticed this problem, because some of code in client-python
were based on the logic in client-java
, you'll see some coding style is more like Java, not Pythonic. I think we can create another subtask issue to discuss about how to rewrite this part.
Hi @noidname01
exception I agree that we should prioritize resolving issue https://github.com/apache/gravitino/issues/4012.
unit test Pylint flags the following structure as duplicate code but fixed values expected in unit test.
AuditDTO(
_creator="test",
_create_time="2022-01-01T00:00:00Z",
_last_modifier="test",
_last_modified_time="2024-04-05T10:10:35.218Z",
)
I've considered two solutions:
pythonic code I agree that we should create a separate subtask for this, similar to case 1.
In summary, I believe addressing the duplicated code linting issue is not a priority at this stage. We should focus on reviewing the errors to identify potential architectural improvements.
@ian910297 I think the reason for Problem 2 is that we use the same test component many times and create them in different files, maybe give them different values can solve the problem?
But the problem that every test repeats the same init logic still remains, I think we can move the same logic to parent class (ex. IntegrationTestEnv
in integration tests) to prevent duplicate code, WDYT?
Hi , I'd like to work on this issue. Could you assign it to me ?
Describe the subtask
Parent issue
3560