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: Adding output fields for dataset items #51

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

drobnikj
Copy link
Member

@drobnikj drobnikj commented Nov 1, 2024

In this PR we are adding dynamic outputFields for the action which returns datset items. This requires parsing JavaScript plain object into FieldsShema, the definition of schema is here, this is also part of this PR.

Why we need this:
When user connect Apify into some Zapier flow the output data from Actor run dataset items cannot be easily mapped into next flow, the reason was that we are missing the dataset items into outputFields. See the problem users face - here is reported issue.
By adding dataset items into outputFields we solve this and the user can easily map the dataset data between Zapier flows.

How to test on Zapier platform

The new version is in preview mode. You need to be part of the Apify developers group on Zapier; I added you.
Then you will see the Apify version when you want to create the Zap, the tested version is 3.2.0.
image

fixes #48

@github-actions github-actions bot added this to the 101st sprint - Platform team milestone Nov 1, 2024
@github-actions github-actions bot added t-platform Issues with this label are in the ownership of the platform team. tested Temporary label used only programatically for some analytics. labels Nov 1, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Pull Request Tookit has failed!

None of the pull request and linked issue has estimate

@fnesveda fnesveda added backend Issues related to the platform backend. medium priority Medium priority issues to be done in a couple of sprints. product roadmap Issues contributing to product roadmap. labels Nov 5, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Pull Request Tookit has failed!

None of the pull request and linked issue has estimate

@@ -130,7 +130,7 @@ const enrichActorRun = async (z, run, storeKeysToInclude = []) => {
};

// Process to subscribe to Apify webhook
const subscribeWebkook = async (z, bundle, condition) => {
const subscribeWebhook = async (z, bundle, condition) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Just fixing typo

@drobnikj drobnikj marked this pull request as ready for review November 23, 2024 13:14
@drobnikj drobnikj assigned fnesveda and unassigned fnesveda Nov 23, 2024
@drobnikj drobnikj requested a review from fnesveda November 23, 2024 13:17
@drobnikj drobnikj changed the title feat: Adding output fields for dataset items [WIP] feat: Adding output fields for dataset items Nov 25, 2024
@jirimoravcik jirimoravcik requested a review from Copilot November 25, 2024 10:18

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 20 changed files in this pull request and generated no suggestions.

Files not reviewed (14)
  • package.json: Language not supported
  • index.js: Evaluated as low risk
  • test/zapier_helpers.js: Evaluated as low risk
  • CHANGELOG.md: Evaluated as low risk
  • test/helpers/index.js: Evaluated as low risk
  • test/creates/actor_run.js: Evaluated as low risk
  • src/zapier_helpers.js: Evaluated as low risk
  • src/apify_helpers.js: Evaluated as low risk
  • src/triggers/actor_run_finished.js: Evaluated as low risk
  • src/triggers/task_run_finished.js: Evaluated as low risk
  • src/searches/task_last_run.js: Evaluated as low risk
  • src/searches/actor_last_run.js: Evaluated as low risk
  • src/creates/actor_run.js: Evaluated as low risk
  • src/creates/task_run.js: Evaluated as low risk
Comments skipped due to low confidence (2)

src/output_fields.js:27

  • The function 'getDatasetItemsOutputFields' should handle the case where 'items' is empty more gracefully. Consider adding a check before merging items.
if (items.length === 0) return [];

test/creates/task_run.js:47

  • The change from 'expect(testResult).to.have.all.keys' to 'expect(testResult).to.have.any.keys' reduces the strictness of the test. This could allow for unexpected keys to be present in the result, potentially hiding issues.
expect(testResult).to.have.any.keys(Object.keys(TASK_RUN_SAMPLE).concat(['isStatusMessageTerminal', 'statusMessage']));
@drobnikj drobnikj merged commit ff88c65 into master Nov 26, 2024
2 checks passed
@drobnikj drobnikj deleted the feat/output_fields_dataset_items branch November 26, 2024 13:44
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues related to the platform backend. medium priority Medium priority issues to be done in a couple of sprints. product roadmap Issues contributing to product roadmap. t-platform Issues with this label are in the ownership of the platform team. tested Temporary label used only programatically for some analytics. validated Issues that are resolved and their solutions fulfill the acceptance criteria.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improper Data Structure is preventing mapping and manipulation into action steps for other apps
3 participants