Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Streamline stream selection and support for select_streams("*") #52

Merged
merged 6 commits into from
Feb 20, 2024

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Feb 19, 2024

This PR allows a more streamlined single-step source creation and setup.

Instead of requiring multiple steps:

    source = ab.get_source(
        "source-github",
        config=GITHUB_CONFIG,
    )
    source.select_streams(["pull_requests", "issues"])
    read_result = source.read()

We can now do all in a single step:

    read_result = ab.get_source(
        "source-github",
        config=GITHUB_CONFIG,
        streams=["pull_requests", "issues"],
    ).read()

If "*" is specified, it will be treated as "all", equivalent to select_all_streams().

For tutorials, the multi-step process is often preferable, because it allows each step to be debugged in turn. However, for demos, the reverse is true: fewer lines and fewer statement makes the process easier to read and easier to understand overall.

This also allows streams to be specified in read().

Copy link
Contributor

@bindipankhudi bindipankhudi left a comment

Choose a reason for hiding this comment

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

Looks good!

@aaronsteers aaronsteers merged commit 0441fdf into main Feb 20, 2024
11 checks passed
@aaronsteers aaronsteers deleted the aj/feature/inline-stream-select branch February 20, 2024 15:41
@aaronsteers aaronsteers self-assigned this Mar 11, 2024
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