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

Migration SDK Options in Python #26

Closed
jyoung-slalom opened this issue Jul 2, 2024 · 1 comment
Closed

Migration SDK Options in Python #26

jyoung-slalom opened this issue Jul 2, 2024 · 1 comment

Comments

@jyoung-slalom
Copy link

jyoung-slalom commented Jul 2, 2024

As of 4.0.1 release, the Migration SDK Options for Python are not importing correctly. For example, the following variable is added to the .env file:
MigrationSDK__Files__RootPath = 'C:/Users/youngjay/Documents/Temp'

The script makes the following calls:
from dotenv import load_dotenv # Used to load environment variables

# Load the environment variables
load_dotenv()

However, upon execution of the migration plan, the FileOptions.RootPath remain unchanged/continue to use Defaults:
Error: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\youngjay\AppData\Local\Temp\migration-

(Edit to fix formatting in code block)

@tdemoraisribeiro
Copy link
Collaborator

The SDK will load the environment variables on its init process. To be able to load the environment configuration, you must call the load_dotenv() command before referring to any tableau_migration code.

from dotenv import load_dotenv  # Used to load environment variables

# Load the environment variables
load_dotenv()

# first tableau_migration reference
import tableau_migration

Also, you can set environment variables directly in your command prompt. Here is a link for the Power Shell documentation.

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

No branches or pull requests

2 participants