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

SqlSensor parameter fails to capture the replication lag #37437

Closed
1 of 2 tasks
amolsr opened this issue Feb 15, 2024 · 5 comments · Fixed by #43107
Closed
1 of 2 tasks

SqlSensor parameter fails to capture the replication lag #37437

amolsr opened this issue Feb 15, 2024 · 5 comments · Fixed by #43107

Comments

@amolsr
Copy link
Contributor

amolsr commented Feb 15, 2024

Description

Hi,
We need to run the pipeline when there is no replication lag in MySQL database. for this we need to use SqlSensor with SHOW SLAVE STATUS command. The success and the failure callback takes the first cell only and there is no other Select query to get the Seconds_Behind_Master only. Please extend the Sensor for querying the complete dataframe.

Use case/motivation

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@amolsr amolsr added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Feb 15, 2024
@potiuk potiuk added good first issue and removed needs-triage label for new issues that we didn't triage yet labels Feb 15, 2024
@paulooctavio
Copy link

I would be happy to take this one!

@potiuk
Copy link
Member

potiuk commented Sep 3, 2024

Assigned

@vVv-AA
Copy link
Contributor

vVv-AA commented Oct 16, 2024

Hi @potiuk The issue seems to be abandoned. Is it ok if I work on it?

There are 2 ways we can do this change.
SqlSensor already takes a success and failure callable to which the first cell is passed.

  1. A backward incompatible change and pass the whole row into the checker function. It passed checker function can then do its thing on the whole row.
  2. Add a selector parameter Callable[[Tuple[Any]], bool] which would take the whole row, and its output will be passed to the checker functions. To keep backward compatibility selector can be be itemgetter(0) by default

Which one would you prefer?

@potiuk
Copy link
Member

potiuk commented Oct 16, 2024

common.sql should be generally backwards compatible - because we use it by many operators. So 2.

@vVv-AA
Copy link
Contributor

vVv-AA commented Oct 17, 2024

Thanks @potiuk
Have raised the PR accordingly. Please do review when time permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants