Skip to content

feat(python): Add examples (deduplicate, delay) and tests (Issue #42)#47

Merged
0-jake-0 merged 4 commits into
wingfoil-io:mainfrom
adityashirsatrao007:feat/python-examples-tests
Dec 11, 2025
Merged

feat(python): Add examples (deduplicate, delay) and tests (Issue #42)#47
0-jake-0 merged 4 commits into
wingfoil-io:mainfrom
adityashirsatrao007:feat/python-examples-tests

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

This PR addresses Issue #42 by adding new Python examples and a comprehensive test suite.

New Examples:

  • deduplicate.py: Demonstrates using .distinct() to remove consecutive duplicates.
  • delay_line.py: Demonstrates using .delay() for temporal shifting.

New Tests:

  • test_streams.py: unittest suite covering map, ilter, distinct, limit, and collect operators.

This enhances the documentation and provides a verification baseline for Python binding development.

Copilot AI review requested due to automatic review settings December 8, 2025 08:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Issue #42 by adding Python examples demonstrating stream operators and a comprehensive test suite for the Python bindings. It also introduces a new window stream operator in the Rust core.

Key Changes:

  • New Python examples for distinct() and delay() operators with practical demonstrations
  • Test suite covering map, filter, distinct, limit, and collect operators
  • New WindowStream implementation for time-based buffering in Rust
  • Python bindings for GraphState, collect(), and print() stream operators

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
wingfoil/src/nodes/window.rs Implements time-based windowing stream operator with automatic flushing
wingfoil/src/nodes/mod.rs Integrates WindowStream module and adds window() method to StreamOperators trait
wingfoil-python/src/py_stream.rs Adds Python bindings for print() and collect() stream operators
wingfoil-python/src/py_graph_state.rs Exposes GraphState to Python with time tracking functionality
wingfoil-python/src/lib.rs Registers PyGraphState class in the Python module
wingfoil-python/examples/delay_line.py Demonstrates delay() operator for temporal shifting of streams
wingfoil-python/examples/deduplicate.py Demonstrates distinct() operator for filtering consecutive duplicates
wingfoil-python/tests/test_streams.py Unit tests validating map, filter, distinct, limit, and collect operators
Comments suppressed due to low confidence (3)

wingfoil-python/examples/deduplicate.py:9

  • Import of 'wingfoil' is not used.
import wingfoil

wingfoil-python/examples/delay_line.py:9

  • Import of 'wingfoil' is not used.
import wingfoil

wingfoil-python/tests/test_streams.py:2

  • Import of 'wingfoil' is not used.
import wingfoil

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wingfoil-python/src/py_stream.rs Outdated
Comment thread wingfoil-python/tests/test_streams.py Outdated
Comment thread wingfoil-python/tests/test_streams.py Outdated
Comment thread wingfoil/src/nodes/window.rs Outdated
Comment thread wingfoil-python/examples/delay_line.py Outdated
Comment thread wingfoil-python/examples/delay_line.py Outdated
Comment thread wingfoil-python/tests/test_streams.py Outdated
Comment thread wingfoil-python/examples/deduplicate.py Outdated
Comment thread wingfoil-python/examples/delay_line.py Outdated
Comment thread wingfoil-python/tests/test_streams.py Outdated
@0-jake-0

0-jake-0 commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

This is great but can i have just the new python examples by themselves without any other changes please.

@adityashirsatrao007

Copy link
Copy Markdown
Contributor Author

Yes I'll update it in few hours and let you know.

@0-jake-0 0-jake-0 merged commit f7bab76 into wingfoil-io:main Dec 11, 2025
2 checks passed
@0-jake-0

Copy link
Copy Markdown
Contributor

Looks good. Thanks!

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