Skip to content

[BUGFIX] Disable init analytics as it was not really getting entirely disabled when specified on data context config #11276

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

jmcorreia
Copy link
Contributor

@jmcorreia jmcorreia commented Jun 26, 2025

It seems init_analytics is being executed even when people is disabling analytics.
Inside this execution, there seems to be a method self._get_oss_id() searching for a root location cls._ROOT_CONF_FILE.exists() which is producing a permission denied error when used inside forEachBatch streaming on Databricks DBR15.4.

This PR proposes a fix to avoid invoking the init_analytics method if people disable it via config.

If there is other suggestion for a workaround, while this PR is not release, please let me know as this is a bit critical for us.

You can find more context below:

Copy link

netlify bot commented Jun 26, 2025

👷 Deploy request for niobium-lead-7998 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 82e90e8

@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

3 similar comments
@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

@jmcorreia jmcorreia force-pushed the bugfix/disable-init-analytics branch from 5a7f8fb to 1a23fa8 Compare June 26, 2025 09:14
@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

@jmcorreia jmcorreia force-pushed the bugfix/disable-init-analytics branch from 1a23fa8 to 8d04a68 Compare June 26, 2025 09:15
@gx-cla-bot
Copy link

gx-cla-bot bot commented Jun 26, 2025

A new contributor, HUZZAH! Welcome and thanks for joining our community. In order to accept a pull request we require that all contributors sign our Contributor License Agreement. We have two different CLAs, depending on whether you are contributing to GX in a personal or professional capacity. Please sign the one that is applicable to your situation so that we may accept your contribution:

Individual Contributor License Agreement v1.0
Software Grant and Corporate Contributor License Agreement v1.0

Once you have signed the CLA, you can add a comment with the text @cla-bot check and the bot will update the PR status!

Please reach out to the #gx-community-support channel, on our Slack if you have any questions or if you have already signed the CLA and are receiving this message in error.

Users missing a CLA: [email protected]

@jmcorreia jmcorreia force-pushed the bugfix/disable-init-analytics branch from 8d04a68 to 5af98c7 Compare June 26, 2025 09:25
Copy link
Contributor

@wookasz wookasz left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. This looks reasonable. However, there are a few places in the code where init_analytics is invoked. Would you be willing to wrap these other calls in a similar check? If not we can follow up with that later.

Secondly, and this is where I'm requesting changes, the tests do need a little refactoring. test_analytics_enabled_on_load is no longer an appropriate name for the test method (it probably wasn't in the first place). Since we need to explicitly ensure that init_analytics is not called, there should be tests to assert that it is not called when the expected_value is False.

Let me know if you have any questions

…s is not involved.

Move try except block to cover permission denied or other errors while checking file existence
@jmcorreia
Copy link
Contributor Author

thanks for the feedback @wookasz . I have renamed one test and also enhanced it (and 1 more) to capture when it should be enabled and invoke init_analytics and when not.
I did not find more places where you would need to wrap init_analytics with the if statement. In any case, I have moved the if block inside the init_analytics method so you don't need to replicate the if statement in case it needs to be used in more places.
Also moved the try except block to cover possible permission denied or other errors while checking file existence when init_analytics is enabled.
Let me know if anything else is required.

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

Successfully merging this pull request may close these issues.

Ephemeral Data Context Failing with permission denied on file
3 participants