repo_id
stringlengths 32
150
| file_path
stringlengths 46
183
| content
stringlengths 1
290k
| __index_level_0__
int64 0
0
|
---|---|---|---|
/Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora | /Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora/schemas/entityprofile.json | {
"properties": {
"address1": {
"type": [
"null",
"string"
]
},
"address2": {
"type": [
"null",
"string"
]
},
"city": {
"type": [
"null",
"string"
]
},
"country": {
"type": [
"null",
"string"
]
},
"displayEnvironmentBanner": {
"type": [
"null",
"boolean"
]
},
"email": {
"type": [
"null",
"string"
]
},
"expirationDate": {
"type": [
"null",
"string"
]
},
"locale": {
"type": [
"null",
"string"
]
},
"postalCode": {
"type": [
"null",
"string"
]
},
"state": {
"type": [
"null",
"string"
]
},
"status": {
"type": [
"null",
"string"
]
},
"tenantId": {
"type": [
"null",
"string"
]
},
"tenantName": {
"type": [
"null",
"string"
]
},
"timeZone": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora | /Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora/schemas/user.json | {
"properties": {
"createddate": {
"type": [
"null",
"string"
]
},
"email": {
"type": [
"null",
"string"
]
},
"firstname": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"lastname": {
"type": [
"null",
"string"
]
},
"username": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora | /Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora/schemas/securitypolicy.json | {
"properties": {
"enforcePasswordHistory": {
"type": [
"null",
"integer"
]
},
"lockoutEffectivePeriod": {
"type": [
"null",
"integer"
]
},
"maximumInvalidLoginAttempts": {
"type": [
"null",
"integer"
]
},
"minimumPasswordLength": {
"type": [
"null",
"integer"
]
},
"passwordComplexityRequirement": {
"type": [
"null",
"string"
]
},
"passwordExpiration": {
"type": [
"null",
"integer"
]
},
"sessionTimeout": {
"type": [
"null",
"integer"
]
},
"twoFactor": {
"type": [
"null",
"boolean"
]
},
"twoFactorRememberTime": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora | /Users/nchebolu/work/raptor/taps/tap-zuora/src/tap_zuora/schemas/userrole.json | {
"properties": {
"attributes": {
"items": {
"properties": {
"activationLevel": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"scope": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"category": {
"type": [
"null",
"string"
]
},
"custom": {
"type": [
"null",
"boolean"
]
},
"description": {
"type": [
"null",
"string"
]
},
"entityId": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-tableau/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-tableau"
description = "`tap-tableau` is a Singer tap for tableau, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "tableau"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0",
"cached-property==1"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-tableau = "tap_tableau.tap:TapTableau.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-tableau/README.md | # tap-tableau
`tap-tableau` is a Singer tap for Tableau.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
_**Note:** This tap is only built for Tableau Cloud, not Tableau Server. All streams and configuration options assume the use of Tableau Cloud._
The following endpoints are unavailable for Tableau Cloud:
- https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_site.htm#query_site
- https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_dashboard_extensions_settings.htm#DashboardExtensionsServerSettingsService_getDashboardExtensionsBlockListItems
- https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_dashboard_extensions_settings.htm#DashboardExtensionsServerSettingsService_getDashboardExtensionsServerSettings
- https://help.tableau.com/current/api/rest_api/en-us/REST/TAG/index.html#operation/AuthnService_ListIdentityStoresTAG
- https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_connected_app.htm#get_connectedapps_eas (not documented as unavailable for Tableau Cloud, but testing indicates it is)
## Installation
An example GitLab installation command:
```bash
pipx install git+https://gitlab.com/ORG_NAME/tap-tableau.git
```
## Configuration
### Accepted Config Options
| Setting | Required | Default | Description |
|:--------------------|:--------:|:-------:|:------------|
| pat_name | True | None | The name for your Personal Access Token. |
| pat_secret | True | None | The secret identifier for your Personal Access Token. |
| content_url | True | None | The URL identifier for your site. When you are logged into Tableau, this is the value that appears directly after `/site/` in your browser's address bar. |
| api_url | True | None | The URL for the API itself. When you are logged into Tableau, this is the first portion of the URL in your browser's address bar, up to and including `tableau.com`. |
A full list of supported settings and capabilities for this
tap is available by running:
```bash
tap-tableau --about
```
### Configure using environment variables
This Singer tap will automatically import any environment variables within the working directory's
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.
### Source Authentication and Authorization
Although Tableau has multiple methods of authentication, the only one with access to every endpoint this tap uses is a Personal Access Token (PAT). Using their OAuth 2.0 or "Direct Trust" authentication methods restricts access to streams such as MobileSecuritySettingStream() and ConnectionStream(). Using OAuth 2.0 would additionally require setting up an external identity provider.
Creating a PAT can be done by following the steps below:
1. Log in to your Tableau site as an administrator.
2. In the upper right, click your profile picture and then click "My Account Settings".
3. Scroll down to the "Personal Access Tokens" section.
4. Give your PAT a name and then click "Create new token".
5. Copy the displayed values into tap config. Be aware that the Token Secret will only be displayed once.
Be aware that if a PAT is not used for fifteen consecutive days, it will be invalidated. A PAT will also be invalidated after 1 year regardless of usage. [Documentation](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_auth.htm#make-a-sign-in-request-with-a-personal-access-token)
You will also need to determine your site's Content URL. When you are logged into Tableau, this is the value that appears directly after `/site/` in your browser's address bar.
Finally, you will need to provide your API URL. When you are logged into Tableau, this is the first portion of the URL in your browser's address bar, up to and including `tableau.com`.
_**Example:** `https://10ay.online.tableau.com/#/site/MarketingTeam/workbooks` would have `MarketingTeam` as its Content URL and `https://10ay.online.tableau.com` as its API URL._
## Usage
You can easily run `tap-tableau` by itself or in a pipeline using [Meltano](https://meltano.com/).
### Executing the Tap Directly
```bash
tap-tableau --version
tap-tableau --help
tap-tableau --config CONFIG --discover > ./catalog.json
```
## Developer Resources
Follow these instructions to contribute to this project.
### Initialize your Development Environment
```bash
pipx install poetry
poetry install
```
### Create and Run Tests
Create tests within the `tests` subfolder and
then run:
```bash
poetry run pytest
```
You can also test the `tap-tableau` CLI interface directly using `poetry run`:
```bash
poetry run tap-tableau --help
```
### Testing with [Meltano](https://www.meltano.com)
_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._
Next, install Meltano (if you haven't already) and any needed plugins:
```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-tableau
meltano install
```
Now you can test and orchestrate using Meltano:
```bash
# Test invocation:
meltano invoke tap-tableau --version
# OR run a test `elt` pipeline:
meltano elt tap-tableau target-jsonl
```
### SDK Dev Guide
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-tableau/meltano.yml | version: 1
send_anonymous_usage_stats: true
project_id: tap-tableau
default_environment: test
environments:
- name: test
plugins:
extractors:
- name: tap-tableau
namespace: tap_tableau
pip_url: -e .
capabilities:
- state
- catalog
- discover
- about
- stream-maps
settings:
- name: pat_name
kind: password
- name: pat_secret
kind: password
- name: content_url
- name: api_url
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/auth.py | from __future__ import annotations
from datetime import datetime
import requests
from singer_sdk.authenticators import APIAuthenticatorBase, SingletonMeta
from singer_sdk.helpers._util import utc_now
from singer_sdk.streams import Stream as RESTStreamBase
class TableauAuthenticator(APIAuthenticatorBase, metaclass=SingletonMeta):
"""API Authenticator for Tableau."""
def __init__(
self,
stream: RESTStreamBase,
endpoint: str | None = None,
default_expiration: int | None = None,
) -> None:
"""Create a new authenticator.
Args:
stream: The stream instance to use with this authenticator.
default_expiration: Default token expiry in seconds.
"""
super().__init__(stream=stream)
self._auth_endpoint = endpoint
self._default_expiration = default_expiration
# Initialize internal tracking attributes
self.access_token: str | None = None
self.last_refreshed: datetime | None = None
self.expires_in: int | None = None
@property
def auth_headers(self) -> dict:
"""Return a dictionary of auth headers to be applied.
These will be merged with any `http_headers` specified in the stream.
Returns:
HTTP headers for authentication.
"""
if not self.is_token_valid():
self.update_access_token()
result = super().auth_headers
result["X-Tableau-Auth"] = f"{self.access_token}"
return result
@property
def auth_endpoint(self) -> str:
"""Get the authorization endpoint.
Returns:
The API authorization endpoint if it is set.
Raises:
ValueError: If the endpoint is not set.
"""
if not self._auth_endpoint:
msg = "Authorization endpoint not set."
raise ValueError(msg)
return self._auth_endpoint
@property
def request_headers(self) -> dict:
"""Get request headers.
Returns:
A request headers.
"""
headers = {}
headers["Accept"] = "application/json"
headers[
"Content-Type"
] = "application/json" # As per: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_auth.htm#make-a-sign-in-request-with-a-personal-access-token
return headers
@property
def request_body(self) -> dict:
"""Get request headers.
Returns:
A request headers.
"""
return {
"credentials": {
"personalAccessTokenName": self.config["pat_name"],
"personalAccessTokenSecret": self.config["pat_secret"],
"site": {
"contentUrl": self.config["content_url"],
},
},
}
def is_token_valid(self) -> bool:
"""Check if token is valid.
Returns:
True if the token is valid (fresh).
"""
if self.last_refreshed is None:
return False
if not self.expires_in:
return True
if self.expires_in > (utc_now() - self.last_refreshed).total_seconds():
return True
return False
# Authentication and refresh
def update_access_token(self) -> None:
"""Update `access_token` along with: `last_refreshed` and `expires_in`.
Raises:
RuntimeError: When login fails.
"""
self.last_refreshed = utc_now()
self.logger.info(f"Attempting login... UTC_NOW: {self.last_refreshed }")
token_response = requests.post(self.auth_endpoint, headers=self.request_headers, json=self.request_body)
try:
token_response.raise_for_status()
self.logger.info("Authorization attempt was successful.")
except requests.exceptions.HTTPError as ex:
msg = f"Failed login, response was '{token_response.json()}'. {ex}"
raise RuntimeError(
msg,
)
token_json = token_response.json()
self.access_token = token_json["credentials"]["token"]
self.expires_in = self._default_expiration
if self.expires_in is None:
self.logger.debug(
"No value for expires_in. Token will be treated as if it never expires.",
)
@classmethod
def create_for_stream(cls, stream) -> APIAuthenticatorBase:
auth_api = stream.url_base + "/api/3.19/auth/signin"
# Tokens expire after 240 minutes. https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_authentication.htm#sign_in
return cls(stream=stream, endpoint=auth_api, default_expiration=14400)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/streams.py | """Stream type classes for tap-tableau."""
from __future__ import annotations
from pathlib import Path
from singer_sdk import typing as th # JSON Schema typing helpers.
from tap_tableau.client import TableauPaginator, TableauStream
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class SiteStream(TableauStream):
name = "site"
path = "/api/3.19/sites/{content_url}"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.site"
def get_child_context(self, record: dict, context: th.Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {
"_sdc_site_id": record["id"],
}
def get_url_params(
self,
context: dict | None,
next_page_token: th.Any | None,
) -> dict[str, th.Any]:
params = super().get_url_params(context=context, next_page_token=next_page_token)
params[
"key"
] = "contentURL" # The site is being uniquely identified by its content URL instead of its Locally Unique Identifier (LUID). Other streams used the LUID returned from this stream instead of content URL.
params[
"includeUsage"
] = "true" # To provide additional information on the site's total users and storage space.
return params
class UserStream(TableauStream):
name = "user"
path = "/api/3.19/sites/{_sdc_site_id}/users"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.users.user[*]"
parent_stream_type = SiteStream
partitions = None # Must be explicitly marked as None due to override of from_parent_context() in client.py
def get_child_context(self, record: dict, context: th.Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {
# Pass SiteStream() context to its grandchildren.
"_sdc_site_id": context["_sdc_site_id"],
"_sdc_user_id": record["id"],
}
def get_new_paginator(self):
return TableauPaginator(start_value=1)
class MobileSecuritySettingStream(TableauStream):
name = "mobilesecuritysetting"
path = "/api/3.19/sites/{_sdc_site_id}/settings/mobilesecuritysettings"
primary_keys = ["name"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.mobileSecuritySettingsList.mobileSecuritySettings[*]"
parent_stream_type = SiteStream
partitions = None # Must be explicitly marked as None due to override of from_parent_context() in client.py
class FlowStream(TableauStream):
name = "flow"
path = "/api/3.19/sites/{_sdc_site_id}/flows"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.flows.flow[*]"
parent_stream_type = SiteStream
partitions = None # Must be explicitly marked as None due to override of from_parent_context() in client.py
def get_child_context(self, record: dict, context: th.Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {
# Pass SiteStream() context to its grandchildren.
"_sdc_site_id": context["_sdc_site_id"],
"_sdc_flow_id": record["id"],
}
def get_new_paginator(self):
return TableauPaginator(start_value=1)
class FlowPermissionStream(TableauStream):
name = "flow_permission"
path = "/api/3.19/sites/{_sdc_site_id}/flows/{_sdc_flow_id}/permissions"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.permissions[*]"
parent_stream_type = FlowStream
partitions = None # Must be explicitly marked as None due to override of from_parent_context() in client.py
def get_new_paginator(self):
return TableauPaginator(start_value=1)
class ConnectionStream(TableauStream):
name = "connection"
path = "/api/-/settings/site/extensions/analytics/connections"
primary_keys = ["connection_luid"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.connectionList[*]"
class ProjectStream(TableauStream):
name = "project"
path = "/api/3.19/sites/{_sdc_site_id}/projects"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.projects.project[*]"
parent_stream_type = SiteStream
partitions = None # Must be explicitly marked as None due to override of from_parent_context() in client.py
def get_child_context(self, record: dict, context: th.Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {
# Pass SiteStream() context to its grandchildren.
"_sdc_site_id": context["_sdc_site_id"],
"_sdc_project_id": record["id"],
}
def get_new_paginator(self):
return TableauPaginator(start_value=1)
class ProjectDefaultPermissionStream(TableauStream):
name = "project_defaultpermission"
path = "/api/3.19/sites/{_sdc_site_id}/projects/{_sdc_project_id}/default-permissions/{endpoint}"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.permissions"
parent_stream_type = ProjectStream
# There are many different variants of this endpoint which all return data matching an identical schema.
# Rather than splitting them up into different streaams, a singular partitioned stream is used instead.
# An override of from_parent_context() in client.py is used to combine parent streams with partitions.
@property
def base_partition(self):
return [
{"endpoint": "flows"},
]
partitions = []
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/client.py | """REST client handling, including TableauStream base class."""
from __future__ import annotations
from http import HTTPStatus
import logging
from typing import Any
from collections.abc import Callable, Iterable
import requests
from singer_sdk.pagination import BasePageNumberPaginator
from singer_sdk.streams import RESTStream
from singer_sdk.exceptions import FatalAPIError, RetriableAPIError
from tap_tableau.auth import TableauAuthenticator
_Auth = Callable[[requests.PreparedRequest], requests.PreparedRequest]
class SkippableError(Exception):
"""Raised when there is an error that can be skipped."""
def __init__(self, message: str, response: requests.Response | None = None) -> None:
"""Extends the default with the failed response as an attribute.
Args:
message (str): The Error Message
response (requests.Response): The response object.
"""
super().__init__(message)
self.response = response
# get_new_paginator cannot go in TableauStream() because doing so provides pagination parameters to ConnectionStream(), which throws an error if it recieves any extraneous parameters.
class TableauPaginator(BasePageNumberPaginator):
def has_more(self, response: requests.Response) -> bool:
data = response.json()
if "pagination" not in data:
return False
page_number = int(data["pagination"]["pageNumber"])
page_size = int(data["pagination"]["pageSize"])
total_available = int(data["pagination"]["totalAvailable"])
return page_number * page_size < total_available
class TableauStream(RESTStream):
"""Tableau stream class."""
ignore_codes: list[str] = ["403004", "404004"]
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
api_url = self.config["api_url"]
return f"https://{api_url}"
@property
def content_url(self) -> str:
"""Return the content url, configurable via tap settings."""
return self.config["content_url"]
records_jsonpath = "$[*]"
@property
def authenticator(self) -> TableauAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return TableauAuthenticator.create_for_stream(self)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
headers["Accept"] = "application/json"
return headers
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
if next_page_token:
params["pageNumber"] = next_page_token
params[
"pageSize"
] = "1000" # 1000 is the maximum page size, despite documentation saying it can be "any positive integer". https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_paging.htm
return params
def response_error_message(self, response: requests.Response) -> str:
"""Provide additional error message information (JSON body) if something goes wrong."""
try:
json_info = "\n" + "JSON Data: " + str(response.json())
except requests.exceptions.JSONDecodeError:
json_info = ""
return super().response_error_message(response) + json_info
# Sourced from: https://github.com/AutoIDM/tap-clickup/pull/117/files#diff-4490b7dbe49a82fea4fdf63d08c6c503536d30f56841c428f2998bf03b4b94a2
def from_parent_context(self, context: dict):
# Requires streams which use parent-child relationships but not permissions to explicitly declare so.
if self.partitions is None:
return context
else:
# Goal here is to combine Parent/Child relationships with Partions
# Another way to think about this is that Partitions are now
# Lists of contexts, used to create multiple requests based on one context.
# ie we have one team_id and we need a requst
# for archieved=true and archieved=False
# For N Child relationships if we have K base_partitions we'll end up with N*K partitions
# Assumption is that base_partition is a list of dicts
child_context_plus_base_partition = []
for partition in self.base_partition:
child_plus_partition = context.copy()
child_plus_partition.update(partition)
child_context_plus_base_partition.append(child_plus_partition)
self.partitions = child_context_plus_base_partition
return None # self.partitions handles context in the _sync call. Important this is None to use partitions
# Sourced from: https://github.com/AutoIDM/tap-clickup/pull/117/files#diff-4490b7dbe49a82fea4fdf63d08c6c503536d30f56841c428f2998bf03b4b94a2
def _sync_children(self, child_context: dict) -> None:
for child_stream in self.child_streams:
if child_stream.selected or child_stream.has_selected_descendents:
child_stream.sync(
child_stream.from_parent_context(context=child_context),
)
def get_records(self, context: dict | None) -> Iterable[dict[str, Any]]:
try:
yield from super().get_records(context)
except SkippableError as e:
self.logger.error(e)
self.logger.warn(f"Encountered error that can be skipped. Response: {e.response.text}")
yield {}
def validate_response(self, response: requests.Response) -> None:
msg = self.response_error_message(response)
error_code = response.json().get("error", {}).get("code")
if error_code in self.ignore_codes:
raise SkippableError(msg, response)
if (
response.status_code in self.extra_retry_statuses
or HTTPStatus.INTERNAL_SERVER_ERROR <= response.status_code <= max(HTTPStatus)
):
raise RetriableAPIError(msg, response)
if HTTPStatus.BAD_REQUEST <= response.status_code < HTTPStatus.INTERNAL_SERVER_ERROR:
raise FatalAPIError(msg)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/__init__.py | """Tap for Tableau."""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/tap.py | """Tableau tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_tableau import streams
class TapTableau(Tap):
"""Tableau tap class."""
name = "tap-tableau"
config_jsonschema = th.PropertiesList(
th.Property(
"pat_name",
th.StringType,
required=True,
secret=True, # Flag config as protected.
description="The name for your Personal Access Token.",
),
th.Property(
"pat_secret",
th.StringType,
required=True,
secret=True, # Flag config as protected.
description="The secret identifier for your Personal Access Token.",
),
th.Property(
"content_url",
th.StringType,
required=True,
description="The URL identifier for your site. When you are logged into Tableau, this is the value that appears directly after `/site/` in your browser's address bar.",
),
th.Property(
"api_url",
th.StringType,
required=True,
description="The URL for the API itself. When you are logged into Tableau, this is the first portion of the URL in your browser's address bar, up to and including `tableau.com`. Example: https://prod-useast-b.online.tableau.com",
),
).to_dict()
def discover_streams(self) -> list[streams.TableauStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.SiteStream(self),
streams.UserStream(self),
streams.MobileSecuritySettingStream(self),
streams.FlowStream(self),
streams.FlowPermissionStream(self),
streams.ConnectionStream(self),
streams.ProjectStream(self),
streams.ProjectDefaultPermissionStream(self),
]
if __name__ == "__main__":
TapTableau.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/project_defaultpermission.json | {
"properties": {
"_sdc_project_id": {
"type": [
"null",
"string"
]
},
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"granteeCapabilities": {
"items": {
"properties": {
"capabilities": {
"properties": {
"capability": {
"items": {
"properties": {
"mode": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"group": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"user": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"project": {
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owner": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/site.json | {
"properties": {
"adminMode": {
"type": [
"null",
"string"
]
},
"allowSubscriptionAttachments": {
"type": [
"null",
"boolean"
]
},
"askDataMode": {
"type": [
"null",
"string"
]
},
"attributeCaptureEnabled": {
"type": [
"null",
"boolean"
]
},
"authoringEnabled": {
"type": [
"null",
"boolean"
]
},
"autoSuspendRefreshEnabled": {
"type": [
"null",
"boolean"
]
},
"autoSuspendRefreshInactivityWindow": {
"type": [
"null",
"integer"
]
},
"catalogingEnabled": {
"type": [
"null",
"boolean"
]
},
"cmekEnabled": {
"type": [
"null",
"boolean"
]
},
"commentingEnabled": {
"type": [
"null",
"boolean"
]
},
"commentingMentionsEnabled": {
"type": [
"null",
"boolean"
]
},
"contentMigrationToolEnabled": {
"type": [
"null",
"boolean"
]
},
"contentUrl": {
"type": [
"null",
"string"
]
},
"customSubscriptionEmailEnabled": {
"type": [
"null",
"boolean"
]
},
"customSubscriptionFooterEnabled": {
"type": [
"null",
"boolean"
]
},
"dataAccelerationMode": {
"type": [
"null",
"string"
]
},
"dataAlertsEnabled": {
"type": [
"null",
"boolean"
]
},
"derivedPermissionsEnabled": {
"type": [
"null",
"boolean"
]
},
"disableSubscriptions": {
"type": [
"null",
"boolean"
]
},
"dqwSubscriptionsEnabled": {
"type": [
"null",
"boolean"
]
},
"editingFlowsEnabled": {
"type": [
"null",
"boolean"
]
},
"explainDataEnabled": {
"type": [
"null",
"boolean"
]
},
"extractEncryptionMode": {
"type": [
"null",
"string"
]
},
"flowAutoSaveEnabled": {
"type": [
"null",
"boolean"
]
},
"flowsEnabled": {
"type": [
"null",
"boolean"
]
},
"guestAccessEnabled": {
"type": [
"null",
"boolean"
]
},
"id": {
"type": [
"null",
"string"
]
},
"loginBasedLicenseManagementEnabled": {
"type": [
"null",
"boolean"
]
},
"mfaEnforcementExemption": {
"type": [
"null",
"boolean"
]
},
"name": {
"type": [
"null",
"string"
]
},
"namedSharingEnabled": {
"type": [
"null",
"boolean"
]
},
"personalSpaceEnabled": {
"type": [
"null",
"boolean"
]
},
"personalSpaceStorageQuota": {
"type": [
"null",
"string"
]
},
"requestAccessEnabled": {
"type": [
"null",
"boolean"
]
},
"revisionHistoryEnabled": {
"type": [
"null",
"boolean"
]
},
"revisionLimit": {
"type": [
"null",
"string"
]
},
"runNowEnabled": {
"type": [
"null",
"boolean"
]
},
"schedulingFlowsEnabled": {
"type": [
"null",
"boolean"
]
},
"selfServiceScheduleForRefreshEnabled": {
"type": [
"null",
"boolean"
]
},
"state": {
"type": [
"null",
"string"
]
},
"storageQuota": {
"type": [
"null",
"string"
]
},
"subscribeOthersEnabled": {
"type": [
"null",
"boolean"
]
},
"tierCreatorCapacity": {
"type": [
"null",
"string"
]
},
"tierExplorerCapacity": {
"type": [
"null",
"string"
]
},
"tierViewerCapacity": {
"type": [
"null",
"string"
]
},
"usage": {
"properties": {
"numCreators": {
"type": [
"null",
"string"
]
},
"numExplorers": {
"type": [
"null",
"string"
]
},
"numUsers": {
"type": [
"null",
"string"
]
},
"numViewers": {
"type": [
"null",
"string"
]
},
"storage": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"useDefaultTimeZone": {
"type": [
"null",
"boolean"
]
},
"userQuota": {
"type": [
"null",
"string"
]
},
"userVisibilityMode": {
"type": [
"null",
"string"
]
},
"webExtractionEnabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/project.json | {
"properties": {
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"contentPermissions": {
"type": [
"null",
"string"
]
},
"createdAt": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owner": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"updatedAt": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/connection.json | {
"properties": {
"connection_brief": {
"properties": {
"connection_name": {
"type": [
"null",
"string"
]
},
"connection_type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"connection_luid": {
"type": [
"null",
"string"
]
},
"host": {
"type": [
"null",
"string"
]
},
"is_auth_enabled": {
"type": [
"null",
"boolean"
]
},
"is_ssl_enabled": {
"type": [
"null",
"boolean"
]
},
"password": {
"type": [
"null",
"string"
]
},
"port": {
"type": [
"null",
"integer"
]
},
"username": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/flow_permission.json | {
"properties": {
"_sdc_flow_id": {
"type": [
"null",
"string"
]
},
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"flow": {
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owner": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"granteeCapabilities": {
"items": {
"properties": {
"capabilities": {
"properties": {
"capability": {
"items": {
"properties": {
"mode": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"group": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"user": {
"properties": {
"id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
}
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/flow.json | {
"properties": {
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"createdAt": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"fileType": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owner": {
"properties": {
"email": {
"type": [
"null",
"string"
]
},
"fullName": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
}
}
},
"parameters": {
"parameter": {
"properties": {
"description": {
"type": [
"null",
"string"
]
},
"domain": {
"properties": {
"domainType": {
"type": [
"null",
"string"
]
},
"values": {
"properties": {
"value": {
"type": [
"null",
"integer"
]
}
}
}
}
},
"id": {
"type": [
"null",
"string"
]
},
"isRequired": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
}
}
},
"project": {
"properties": {
"description": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
}
}
},
"updatedAt": {
"type": [
"null",
"string"
]
},
"webpageUrl": {
"type": [
"null",
"string"
]
}
}
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/user.json | {
"properties": {
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"authSetting": {
"type": [
"null",
"string"
]
},
"domain": {
"properties": {
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"email": {
"type": [
"null",
"string"
]
},
"externalAuthUserId": {
"type": [
"null",
"string"
]
},
"fullName": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"language": {
"type": [
"null",
"string"
]
},
"lastLogin": {
"type": [
"null",
"string"
]
},
"locale": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"siteRole": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau | /Users/nchebolu/work/raptor/taps/tap-tableau/src/tap_tableau/schemas/mobilesecuritysetting.json | {
"properties": {
"_sdc_site_id": {
"type": [
"null",
"string"
]
},
"androidConfig": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
},
"severity": {
"type": [
"null",
"string"
]
},
"valueList": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"iosConfig": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
},
"severity": {
"type": [
"null",
"string"
]
},
"valueList": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |