Skip to content

Conversation

@GregHetherington
Copy link
Contributor

For Vena Developers

Ticket #: https://venasolutions.atlassian.net/browse/VDP-36907

Description

Override the user agent to be able to identify requests used in Microsoft Fabric

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Other (please describe):

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Notes

None

@snyk-io
Copy link

snyk-io bot commented Sep 5, 2025

🎉 Snyk checks have passed. No issues have been found so far.

code/snyk check is complete. No issues have been found. (View Details)

vepi/vena_etl.py Outdated
Comment on lines 92 to 96
try:
from notebookutils import mssparkutils
return f"{lib_name}/{lib_version}; platform/Microsoft Fabric"
except ImportError:
return f"{lib_name}/{lib_version}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This library notebookutils / mssparkutils only exists in Microsoft Fabric, so it will fail outside of that environment. I'm open to other suggestions for identifying Fabric but many of the other approaches required more dependencies like os and the code looked more suspect.

Copy link

Choose a reason for hiding this comment

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

Might be able to use the os object (import os) to determine where the script is running. If you print the environment variables inside a fabric notebook, you'll see that there's some references to "fabric", "azure" and "microsoft".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I tried the import os approach and the code worked but was messy, I had to check for the AZURE_OPENAI_API_KEY key which had this in it "place_holder_for_fabric_internal"

Copy link

Choose a reason for hiding this comment

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

Maybe we can ask microsoft to just place an environment variable that clearly states that python is running in fabric. If they add it then we could come back to this later and update it

api_user (str): API user from Vena authentication token
api_key (str): API key from Vena authentication token
template_id (str): ETL template ID
data_source (str): Please indicate the ERP or data source, this helps Vena with support and troubleshooting.(e.g., NetSuite, Dynamics 365, SAP, ADP, Other)
Copy link

Choose a reason for hiding this comment

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

How do you feel about making a bunch of string constants or making this an enum? Standardizing these values would make triaging and gathering metrics easier. For example, one customer might use intacct and another might use sage but they're both the same source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only issue with this is if we don't have an Enum for the all the different systems(which there are too many to list). This will be used to help us understand issues with the library or import jobs in Vena.

Copy link

Choose a reason for hiding this comment

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

Yea I was thinking we do something like

enum DataSources { 
NETSUITE,
INTACCT,
// If your source is not listed here then add it
}

This way we standardize the most common sources and then in future updates we can extend this to include the common enums that users create themselves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh did you mean we should recommend sources names(with the ENUM), but don't add them to Repo as mandatory, so its still a string?

Copy link

Choose a reason for hiding this comment

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

that works too. Just want to give the customer a list of standardized names, whether that's through an enum, list of string constants or some other way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I think I'll update some of the sample code in the ReadMe with the most common ones in a follow up PR. I don't want it to be strict, and tbh some users won't want to share their data source, which is fine.

Copy link

@MxSahil MxSahil left a comment

Choose a reason for hiding this comment

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

Left a suggestion for the data_sources variable but it LGTM

@GregHetherington GregHetherington merged commit 93480f0 into main Sep 12, 2025
2 checks passed
@GregHetherington GregHetherington deleted the VDP-36907/labelMicrosoftFabricReqs branch September 12, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants