Skip to content

Conversation

yh-0
Copy link
Contributor

@yh-0 yh-0 commented May 15, 2025

https://issues.hibernatingrhinos.com/issue/RDBC-670

Rebased changes from #168
Fixed issue with duplicated constants files (ravendb/constants.py and ravendb/primitives/constants.py).
Fixed minor issues with class members names and imports.
Made sure tests related to streaming pass.

@poissoncorp
Copy link
Contributor

Please run black code formatter over the changes 🙏 it complains about it

class Users_ByName(AbstractIndexCreationTask):
def __init__(self):
super(Users_ByName, self).__init__()
self.map = "from u in docs.Users select new { u.name, lastName = u.lastName.Boost(10) }"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't be "last_name"?


with self.store.open_session() as session:
query = session.query_index_type(Users_ByName, User)
stream, stats = session.advanced.stream_with_statistics(query)
Copy link
Contributor

Choose a reason for hiding this comment

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

usually we take stats callback as a second argument in "statistics" method - here

def statistics(self, stats_callback: Callable[[QueryStatistics], None]) -> DocumentQuery[_T]:

Copy link
Contributor

@poissoncorp poissoncorp May 19, 2025

Choose a reason for hiding this comment

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

should we do the same here?

@poissoncorp
Copy link
Contributor

poissoncorp commented May 19, 2025

let's address those comments, and fix your added tests. you can unittest.skip the one with 3!=5 for now, but the rest should be passing, so we're green again

with self.store.open_session() as session:

def __stats_callback(statistics: StreamQueryStatistics):
self.assertEqual("Users/ByName", statistics.index_name)
Copy link
Contributor

@poissoncorp poissoncorp May 19, 2025

Choose a reason for hiding this comment

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

also, check if the program runs this code

e.g. set flag callback_ran to True at the end of the callback and check at the end of the test if the callback_ran is True, not False

@yh-0 yh-0 force-pushed the RDBC-670-1 branch 2 times, most recently from c49402d to 9461af4 Compare May 20, 2025 07:23
@poissoncorp poissoncorp merged commit 1c42790 into ravendb:v7.0 May 20, 2025
4 checks passed
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.

2 participants