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

[Core] Replace pyjq with jq.py #1049

Merged
merged 27 commits into from
Sep 29, 2024
Merged

[Core] Replace pyjq with jq.py #1049

merged 27 commits into from
Sep 29, 2024

Conversation

Tankilevitch
Copy link
Contributor

@Tankilevitch Tankilevitch commented Sep 25, 2024

Description

What -

Why - Upgrades internal jq version to latest 1.7.1 from 1.5.1

How -

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.

@Tankilevitch Tankilevitch requested a review from a team as a code owner September 25, 2024 08:17
@phalbert
Copy link
Contributor

phalbert commented Sep 25, 2024

Oh this may finally solve the problems I have always had installing pyjq. It seems stuck on 2.6 for so long and an old build way. Is that why you changed to jq.py?

Copy link
Member

@matan84 matan84 left a comment

Choose a reason for hiding this comment

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

LGTM

pyproject.toml Outdated Show resolved Hide resolved
value = await loop.run_in_executor(None, func.first)
execute_time = loop.time() - start_time - compile_time
logger.debug(
f"Search for pattern {execute_time:.2f} seconds, compile time {compile_time:.2f} seconds"
Copy link
Member

Choose a reason for hiding this comment

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

This is golden, I wonder if it's possible to also send the explicit metrics as values in addition to the debug log text

@pytest.mark.asyncio
class TestJQEntityProcessor:

@pytest.fixture
Copy link
Member

Choose a reason for hiding this comment

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

Oh nice, closure automagically since it's in the test class?
If so, good practice that's worth sharing.

@@ -78,6 +78,7 @@ types-python-dateutil = "^2.9.0.20240316"
types-pyyaml = "^6.0.12.10"
types-toml = "^0.10.8.6"
yamllint = "^1.32.0"
pytest-timeout = "^2.3.1"
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth aligning this in all integrations + cookie cutter as well

@@ -174,4 +175,4 @@ exclude = '''
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "-vv -n auto --ignore-glob='./integrations/*' ./port_ocean/tests"
addopts = "-vv -n auto --durations=10 --color=yes --ignore-glob='./integrations/*' ./port_ocean/tests"
Copy link
Member

Choose a reason for hiding this comment

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

Ditto re integrations

Copy link
Member

@erikzaadi erikzaadi left a comment

Choose a reason for hiding this comment

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

image

@Tankilevitch Tankilevitch merged commit 434e0cd into main Sep 29, 2024
14 checks passed
@Tankilevitch Tankilevitch deleted the change-jqpy-to-pyjq branch September 29, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Framework] IN filter not supported by ocean JQ processor
4 participants