-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Apify - Get Dataset Items, Run Task Synchronously #16212
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis pull request introduces new Apify actions and updates existing ones. It adds two new modules: one for retrieving dataset items ("Get Dataset Items") and another for running tasks synchronously ("Run Task Synchronously"). Additionally, the Apify app file is enhanced with new dataset-related properties and helper methods. Several existing modules have their version numbers bumped, and the package version and dependency for Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant GDI as Get Dataset Items Action
participant API as Apify API
C->>GDI: Invoke action with datasetId, filters, maxResults
GDI->>API: Request dataset items with limit & offset
API-->>GDI: Return page of items
loop While more items available & below maxResults
GDI->>API: Request next page
API-->>GDI: Return next set of items
end
GDI->>C: Return aggregated items and summary
sequenceDiagram
participant C as Client
participant RTS as Run Task Synchronously Action
participant API as Apify API
C->>RTS: Invoke action with taskId and parameters
RTS->>API: Call runTaskSynchronously with provided options
API-->>RTS: Return task execution response
RTS->>C: Return response and summary message
Assessment against linked issues
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/apify/actions/run-actor/run-actor.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/apify/actions/get-dataset-items/get-dataset-items.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/apify/actions/run-task-synchronously/run-task-synchronously.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
components/apify/actions/run-task-synchronously/run-task-synchronously.mjs (1)
76-79: Use optional chaining for cleaner code.The current implementation uses logical AND operators for optional fields, but optional chaining would be more elegant.
- fields: this.fields && this.fields.join(), - omit: this.omit && this.omit.join(), - flatten: this.flatten && this.flatten.join(), + fields: this.fields?.join(), + omit: this.omit?.join(), + flatten: this.flatten?.join(),🧰 Tools
🪛 Biome (1.9.4)
[error] 76-76: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 77-77: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 78-78: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
components/apify/actions/get-dataset-items/get-dataset-items.mjs (1)
54-56: Use optional chaining for cleaner code.Similar to the other action, optional chaining would be more elegant here.
- fields: this.fields && this.fields.join(), - omit: this.omit && this.omit.join(), - flatten: this.flatten && this.flatten.join(), + fields: this.fields?.join(), + omit: this.omit?.join(), + flatten: this.flatten?.join(),🧰 Tools
🪛 Biome (1.9.4)
[error] 54-54: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 55-55: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 56-56: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
components/apify/apify.app.mjs (1)
100-105: Improve null handling with nullish coalescing.While the current implementation works, using nullish coalescing with optional chaining would be more elegant.
- return items?.map(({ - id: value, name: label, - }) => ({ - label, - value, - })) || []; + return items?.map(({ + id: value, name: label, + }) => ({ + label, + value, + })) ?? [];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
components/apify/actions/get-dataset-items/get-dataset-items.mjs(1 hunks)components/apify/actions/run-actor/run-actor.mjs(1 hunks)components/apify/actions/run-task-synchronously/run-task-synchronously.mjs(1 hunks)components/apify/actions/scrape-single-url/scrape-single-url.mjs(1 hunks)components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs(1 hunks)components/apify/apify.app.mjs(2 hunks)components/apify/package.json(2 hunks)components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs(1 hunks)components/apify/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
components/apify/actions/get-dataset-items/get-dataset-items.mjs
[error] 54-54: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 55-55: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 56-56: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
components/apify/actions/run-task-synchronously/run-task-synchronously.mjs
[error] 76-76: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 77-77: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 78-78: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
🔇 Additional comments (16)
components/apify/sources/new-finished-task-run-instant/new-finished-task-run-instant.mjs (1)
9-9: Version update is consistent.
The module’s version has been updated to "0.0.2", which aligns with the coordinated version bump across the Apify components.components/apify/sources/new-finished-actor-run-instant/new-finished-actor-run-instant.mjs (1)
9-9: Version update confirmed.
The version field now correctly reflects "0.0.2" in this module, offering consistency with other updated modules.components/apify/actions/run-actor/run-actor.mjs (1)
8-8: Version bump verified.
Updating the version to "0.0.2" is a straightforward change that maintains consistency across the Apify actions. No other changes affect functionality.components/apify/actions/scrape-single-url/scrape-single-url.mjs (1)
8-8: Module version update looks good.
The version increment to "0.0.2" is consistent with the other modules in this release and does not impact the action’s logic or behavior.components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs (1)
8-8: Consistent version update applied.
The version update to "0.0.2" properly aligns this module with the coordinated release. No functionality changes are introduced here.components/apify/package.json (2)
3-3: Version bumped appropriately.Version update from 0.1.0 to 0.2.0 follows semantic versioning principles, reflecting the addition of new features without breaking changes.
16-16: Dependencies updated to support new functionality.The update to @pipedream/platform from ^1.6.5 to ^3.0.3 aligns with the new Apify actions being introduced in this PR.
components/apify/actions/run-task-synchronously/run-task-synchronously.mjs (3)
3-9: New action implementation looks good.The action is properly defined with a clear key, name, description, version, and type.
10-66: Props are well-defined with descriptive labels and documentation.All properties are properly defined with appropriate types, labels, descriptions, and optional flags where needed.
67-86: Run method logic is concise and appropriate.The implementation correctly passes all necessary parameters to the Apify API and provides a helpful summary message. Good job!
🧰 Tools
🪛 Biome (1.9.4)
[error] 76-76: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 77-77: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 78-78: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
components/apify/actions/get-dataset-items/get-dataset-items.mjs (3)
4-9: New dataset items action is well-defined.The action has appropriate metadata including key, name, description, version, and type.
10-48: Props are well-defined and reuse app-level property definitions.All properties correctly reference the propDefinitions from the apify app object.
76-84: Result handling and summary message look great.The logic for truncating results to match maxResults and generating a summary message is well-implemented.
components/apify/apify.app.mjs (3)
89-107: Dataset ID property is well-implemented.The datasetId property includes proper type, label, description, and an async options function to populate a dropdown for selection.
108-138: New properties are well-defined with clear documentation.The properties clean, fields, omit, flatten, and maxResults are properly defined with appropriate types, labels, descriptions, and optional flags.
221-242: New methods for dataset operations are implemented correctly.The methods listDatasets, listDatasetItems, and runTaskSynchronously correctly implement API calls to the Apify endpoints. The implementation follows the pattern established by other methods in the file.
GTFalcao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Resolves #16116
Summary by CodeRabbit
New Features
Chores