Skip to content

Conversation

@vbrodsky
Copy link
Contributor

@vbrodsky vbrodsky commented Aug 1, 2023

No description provided.

@vbrodsky vbrodsky force-pushed the VB/respect-from-cursor_AL-6294 branch from 6d5778e to 87567fe Compare August 1, 2023 21:27
Copy link
Contributor

@kopreschko kopreschko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added a small observation

super().__init__(*args, **kwargs)
self.cursor_path = cursor_path
self.next_cursor: Optional[Any] = None
self.next_cursor: Optional[Any] = kwargs.get('params', {}).get('from')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes the code a bit obscure. To enhance readability and maintainability, what do you think about explicitly adding params to the arguments of the constructor?

Copy link
Contributor Author

@vbrodsky vbrodsky Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is how I had it..
def __init__(self, cursor_path: List[str], params={}, *args, **kwargs):
but in the parent init mypy had issues with it... ok let me look at it again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it like you suggested, but had issues similar to https://stackoverflow.com/questions/21764770/typeerror-got-multiple-values-for-argument with mypy.. so I would prob have to 're-add' it back into kwargs before calling the parent constructor. Let me see

@kopreschko kopreschko self-requested a review August 1, 2023 22:41
def __init__(self, cursor_path: List[str], *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, cursor_path: List[str], params={}, *args, **kwargs):
super().__init__(*args, **dict(kwargs, params=params))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be shorter to just use {**kwargs, **params}
but I think this is getting weirder, it's probably better to leave it as it was before.

@vbrodsky vbrodsky force-pushed the VB/respect-from-cursor_AL-6294 branch from 42327e2 to 87567fe Compare August 1, 2023 23:13
@vbrodsky vbrodsky merged commit cc8eed7 into develop Aug 2, 2023
@vbrodsky vbrodsky deleted the VB/respect-from-cursor_AL-6294 branch August 2, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants