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

Add queued ingest client with support for ingesting from blobs #29

Merged
merged 47 commits into from
Apr 30, 2024

Conversation

krishanjmistry
Copy link
Contributor

@krishanjmistry krishanjmistry commented Nov 3, 2023

What?

Adds a Kusto queued ingest client which supports ingesting from a blob

Things I'm unsure of:

Crate design

Should ingestion functionality be a separate crate or a feature under a combined "data and ingest" crate?

Error handling

Currently this crate uses anyhow - this isn't ideal for a library. I noticed there's a custom Error in the data crate but haven't put much thought into how it could be used. I think it would also differ depending on the crate design
 

Testing

  • unit tests
  • manual testing against an ADX cluster

@krishanjmistry krishanjmistry marked this pull request as ready for review November 3, 2023 17:39
@AsafMah AsafMah self-requested a review November 6, 2023 08:00
* Azure SDK for Rust dependencies to 0.16

* changes
Copy link
Collaborator

@AsafMah AsafMah left a comment

Choose a reason for hiding this comment

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

Great Contribution!
Overall the code is very clean and well commented.

There are a few things to polish - error handilng, lack of tests (though the ones that exist are great), crate managements.

And of course missing options and ingestion methods, which may be out of the scope of this PR.

How would you like to proceed?
Do you expect to work on that more and polish it, or do you want us to take it from here?

azure-kusto-ingest/src/queued_ingest.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/queued_ingest.rs Outdated Show resolved Hide resolved
use azure_kusto_data::models::TableV1;

/// Helper to get a column index from a table
// TODO: this could be moved upstream into Kusto Data - would likely result in a change to the API of this function to return an Option<usize>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably a good idea, we need a better interface for tables in general

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've changed the syntax so it would be ready to move into the data crate - I think the move itself can be done in a separate PR

@AsafMah AsafMah self-requested a review November 28, 2023 10:20
@krishanjmistry
Copy link
Contributor Author

Thanks for taking the time to review @AsafMah

On how we proceed: I'd ideally like to see this through to completion. I'm sure I'll learn something!
I think it's worth us having a chat on the direction you'd like to see this go in terms of the outstanding tasks of:

  • error handling
  • tests
  • crate management

On the missing options and methods, those are out of scope for this PR. I do believe that it is worth considering at this point how they fit into the framework this PR provides.

@AsafMah
Copy link
Collaborator

AsafMah commented Dec 3, 2023

@krishanjmistry for now you can go over the comments I left, that would be most of it.
Let me know if something is not clear

krishanjmistry and others added 3 commits January 18, 2024 20:01
* Use thiserror

* use scopes over explicit use of drop

* update syntax

* remove std::fmt::Debug

* qualify thiserror
* Ingest: Azure SDK changes for 0.19

* remove default features on data dependency in ingest

* Format Rust code using rustfmt

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@krishanjmistry
Copy link
Contributor Author

Hi @AsafMah
I believe I've addressed the comments you've raised.
Do let me know of any other concerns

For starters, I think we'd want to migrate to workspace dependencies

Copy link
Collaborator

@AsafMah AsafMah left a comment

Choose a reason for hiding this comment

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

Great job!
Creative solutions and great error handling.

I've gone through it over again and added more comments, but none of them are very big I'd say.

azure-kusto-ingest/Cargo.toml Outdated Show resolved Hide resolved
azure-kusto-ingest/src/client_options.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager/resource_uri.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager/resource_uri.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager/resource_uri.rs Outdated Show resolved Hide resolved
azure-kusto-ingest/src/resource_manager/resource_uri.rs Outdated Show resolved Hide resolved
* resource_uri changes

* markups in client_options

* resource_manager markups

* remove dependency on chrono - use time

* cache changes

* add missing dev dependency feature

* add some basic tests for caching implementation
@krishanjmistry
Copy link
Contributor Author

@AsafMah, I believe I've addressed all of your most recent comments

@krishanjmistry krishanjmistry requested a review from AsafMah April 4, 2024 08:02
@AsafMah
Copy link
Collaborator

AsafMah commented Apr 11, 2024

I apologize for my lack of attention.
I tried to fit this in with other architectural changes, but sadly this got pushed off due to security critical tasks.

It seems that currently the branch is in conflict with main - can you rebase or merge?

@krishanjmistry
Copy link
Contributor Author

krishanjmistry commented Apr 11, 2024

@AsafMah
Thanks again, I've merged main into this branch via the GitHub UI.
The workflow appears to be facing some authentication issues - likely related to a combination of changes made in #34 and the note in the Actions secrets and variables page that:

Anyone with collaborator access to this repository can use these secrets and variables for actions. They are not passed to workflows that are triggered by a pull request from a fork.

@AsafMah
Copy link
Collaborator

AsafMah commented Apr 30, 2024

That's a general issues with secrets in github with external pull requests, sadly.

@AsafMah AsafMah merged commit e1dca0a into Azure:main Apr 30, 2024
1 of 2 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.

3 participants