Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# general dev/ide files
*.log
*.vscode
*.csv
.idea
*.DS_Store

Expand All @@ -24,19 +23,20 @@ workon/
.coverage
pytest.xml

*.txt
# content
# todo probably want to add a workbook and ds in /res for getting started easily
*.pdf
*.png
*.twbx
*.hyper
*.twb
*.twbr
html
*.html
*.twbr
# *.twbx
# *.hyper
# *.twb
# *.twbr
# *.tdsx
**/credentials.py
*.txt
# exceptions
!tests/assets/

# doit
.doit.*
Expand All @@ -48,6 +48,3 @@ site-packages
tabcmd-dev
workon
test.junit.xml

# exceptions
!tests/assets/detailed_users.csv
Binary file removed World Indicators.tdsx
Binary file not shown.
Binary file removed WorldIndicators.tdsx
Binary file not shown.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ packages = ["tabcmd"]
tabcmd = ["tabcmd.locales/**/*.mo"]
[tool.black]
line-length = 120
required-version = 22
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
extend-exclude = '^/bin/*'
[tool.mypy]
Expand Down
24 changes: 11 additions & 13 deletions tabcmd/commands/datasources_and_workbooks/publish_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,17 @@ def run_command(args):
session = Session()
server = session.create_session(args, logger)

if args.project_name:
try:
dest_project = Server.get_project_by_name_and_parent_path(
logger, server, args.project_name, args.parent_project_path
)
project_id = dest_project.id
except Exception as exc:
logger.error(exc.__str__())
Errors.exit_with_error(logger, _("publish.errors.server_resource_not_found"), exc)
else:
project_id = ""
args.project_name = "default"
if not args.project_name:
args.project_name = "Default"
args.parent_project_path = ""
try:
dest_project = Server.get_project_by_name_and_parent_path(
logger, server, args.project_name, args.parent_project_path
)
project_id = dest_project.id
except Exception as exc:
logger.error(exc.__str__())
Errors.exit_with_error(logger, _("publish.errors.server_resource_not_found"), exc)

publish_mode = PublishCommand.get_publish_mode(args, logger)

Expand Down Expand Up @@ -82,7 +80,7 @@ def run_command(args):
# args.thumbnail_group,
connection_credentials=creds,
as_job=False,
skip_connection_check=False,
skip_connection_check=args.skip_connection_check,
)
except Exception as e:
Errors.exit_with_error(logger, exception=e)
Expand Down
5 changes: 5 additions & 0 deletions tabcmd/execution/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ def set_publish_args(parser):
help="Encrypt extracts in the workbook, datasource, or extract being published to the server. "
"[N/a on Tableau Cloud: extract encryption is controlled by Site Admin]",
)
parser.add_argument(
"--skip-connection-check",
action="store_true",
help="Skip connection check: do not validate the workbook/datasource connection during publishing",
)

# These two only apply for a workbook, not a datasource
thumbnails = parser.add_mutually_exclusive_group()
Expand Down
6 changes: 4 additions & 2 deletions tabcmd/execution/tabcmd_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ def run(parser, user_input=None):
logger.debug(namespace)
if namespace.language:
set_client_locale(namespace.language, logger)

try:
func = namespace.func
# if a subcommand was identified, call the function assigned to it
# this is the functional equivalent of the call by reflection in the previous structure
# https://stackoverflow.com/questions/49038616/argparse-subparsers-with-functions
namespace.func.run_command(namespace)
except AttributeError:
parser.error("No command identified or too few arguments")
except Exception as e:
# todo: use log_stack here for better presentation
# todo: use log_stack here for better presentation?
logger.exception(e)
# if no command was given, argparse will just not create the attribute
sys.exit(2)
Expand Down
Loading