8000 Merge branch 'development' into jorwoods/linked_tasks · tableau/server-client-python@816ba80 · GitHub
[go: up one dir, main page]

Skip to content

Commit 816ba80

Browse files
authored
Merge branch 'development' into jorwoods/linked_tasks
2 parents f8843d4 + 3a53d00 commit 816ba80

29 files changed

+624
-165
lines changed

CONTRIBUTORS.md

+73Lines changed: 73 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,79 @@ The following people have contributed to this project to make it possible, and w
44

55
## Contributors
66

7+
* [jacalata](https://github.com/jacalata)
8+
* [jorwoods](https://github.com/jorwoods)
9+
* [t8y8](https://github.com/t8y8)
10+
* [bcantoni](https://github.com/bcantoni)
11+
* [shinchris](https://github.com/shinchris)
12+
* [vogelsgesang](https://github.com/vogelsgesang)
13+
* [lbrendanl](https://github.com/lbrendanl)
14+
* [LGraber](https://github.com/LGraber)
15+
* [gaoang2148](https://github.com/gaoang2148)
16+
* [benlower](https://github.com/benlower)
17+
* [liu-rebecca](https://github.com/liu-rebecca)
18+
* [guodah](https://github.com/guodah)
19+
* [jdomingu](https://github.com/jdomingu)
20+
* [kykrueger](https://github.com/kykrueger)
21+
* [jz-huang](https://github.com/jz-huang)
22+
* [opus-42](https://github.com/opus-42)
23+
* [markm-io](https://github.com/markm-io)
24+
* [graysonarts](https://github.com/graysonarts)
25+
* [d45](https://github.com/d45)
26+
* [preguraman](https://github.com/preguraman)
27+
* [sotnich](https://github.com/sotnich)
28+
* [mmuttreja-tableau](https://github.com/mmuttreja-tableau)
29+
* [dependabot[bot]](https://github.com/apps/dependabot)
30+
* [scuml](https://github.com/scuml)
31+
* [ovinis](https://github.com/ovinis)
32+
* [FFMMM](https://github.com/FFMMM)
33+
* [martinbpeters](https://github.com/martinbpeters)
34+
* [talvalin](https://github.com/talvalin)
35+
* [dzucker-tab](https://github.com/dzucker-tab)
36+
* [a-torres-2](https://github.com/a-torres-2)
37+
* [nnevalainen](https://github.com/nnevalainen)
38+
* [mbren](https://github.com/mbren)
39+
* [wolkiewiczk](https://github.com/wolkiewiczk)
40+
* [jacobj10](https://github.com/jacobj10)
41+
* [hugoboos](https://github.com/hugoboos)
42+
* [grbritz](https://github.com/grbritz)
43+
* [fpagliar](https://github.com/fpagliar)
44+
* [bskim45](https://github.com/bskim45)
45+
* [baixin137](https://github.com/baixin137)
46+
* [jessicachen79](https://github.com/jessicachen79)
47+
* [gconklin](https://github.com/gconklin)
748
* [geordielad](https://github.com/geordielad)
8-
* [Hugo Stijns](https://github.com/hugoboos)
9-
* [kovner](https://github.com/kovner)
10-
* [Talvalin](https://github.com/Talvalin)
11-
* [Chris Toomey](https://github.com/cmtoomey)
12-
* [Vathsala Achar](https://github.com/VathsalaAchar)
13-
* [Graeme Britz](https://github.com/grbritz)
14-
* [Russ Goldin](https://github.com/tagyoureit)
15-
* [William Lang](https://github.com/williamlang)
16-
* [Jim Morris](https://github.com/jimbodriven)
17-
* [BingoDinkus](https://github.com/BingoDinkus)
18-
* [Sergey Sotnichenko](https://github.com/sotnich)
19-
* [Bruce Zhang](https://github.com/baixin137)
20-
* [Bumsoo Kim](https://github.com/bskim45)
49+
* [fossabot](https://github.com/fossabot)
2150
* [daniel1608](https://github.com/daniel1608)
22-
* [Joshua Jacob](https://github.com/jacobj10)
23-
* [Francisco Pagliaricci](https://github.com/fpagliar)
24-
* [Tomasz Machalski](https://github.com/toomyem)
25-
* [Jared Dominguez](https://github.com/jdomingu)
26-
* [Brendan Lee](https://github.com/lbrendanl)
27-
* [Martin Dertz](https://github.com/martydertz)
28-
* [Christian Oliff](https://github.com/coliff)
29-
* [Albin Antony](https://github.com/user9747)
30-
* [prae04](https://github.com/prae04)
31-
* [Martin Peters](https://github.com/martinbpeters)
32-
* [Sherman K](https://github.com/shrmnk)
33-
* [Jorge Fonseca](https://github.com/JorgeFonseca)
34-
* [Kacper Wolkiewicz](https://github.com/wolkiewiczk)
35-
* [Dahai Guo](https://github.com/guodah)
36-
* [Geraldine Zanolli](https://github.com/illonage)
37-
* [Jordan Woods](https://github.com/jorwoods)
38-
* [Reba Magier](https://github.com/rmagier1)
39-
* [Stephen Mitchell](https://github.com/scuml)
40-
* [absentmoose](https://github.com/absentmoose)
41-
* [Paul Vickers](https://github.com/paulvic)
42-
* [Madhura Selvarajan](https://github.com/maddy-at-leisure)
43-
* [Niklas Nevalainen](https://github.com/nnevalainen)
44-
* [Terrence Jones](https://github.com/tjones-commits)
45-
* [John Vandenberg](https://github.com/jayvdb)
46-
* [Lee Boynton](https://github.com/lboynton)
4751
* [annematronic](https://github.com/annematronic)
48-
49-
## Core Team
50-
51-
* [Chris Shin](https://github.com/shinchris)
52-
* [Lee Graber](https://github.com/lgraber)
53-
* [Tyler Doyle](https://github.com/t8y8)
54-
* [Russell Hay](https://github.com/RussTheAerialist)
55-
* [Ben Lower](https://github.com/benlower)
56-
* [Ang Gao](https://github.com/gaoang2148)
57-
* [Priya Reguraman](https://github.com/preguraman)
58-
* [Jac Fitzgerald](https://github.com/jacalata)
59-
* [Dan Zucker](https://github.com/dzucker-tab)
60-
* [Brian Cantoni](https://github.com/bcantoni)
61-
* [Ovini Nanayakkara](https://github.com/ovinis)
62-
* [Manish Muttreja](https://github.com/mmuttreja-tableau)
52+
* [rshide](https://github.com/rshide)
53+
* [VathsalaAchar](https://github.com/VathsalaAchar)
54+
* [TrimPeachu](https://github.com/TrimPeachu)
55+
* [ajbosco](https://github.com/ajbosco)
56+
* [jimbodriven](https://github.com/jimbodriven)
57+
* [ltiffanydev](https://github.com/ltiffanydev)
58+
* [martydertz](https://github.com/martydertz)
59+
* [r-richmond](https://github.com/r-richmond)
60+
* [sfarr15](https://github.com/sfarr15)
61+
* [tagyoureit](https://github.com/tagyoureit)
62+
* [tjones-commits](https://github.com/tjones-commits)
63+
* [yoshichan5](https://github.com/yoshichan5)
64+
* [wlodi83](https://github.com/wlodi83)
65+
* [anipmehta](https://github.com/anipmehta)
66+
* [cmtoomey](https://github.com/cmtoomey)
67+
* [pes-magic](https://github.com/pes-magic)
68+
* [illonage](https://github.com/illonage)
69+
* [jayvdb](https://github.com/jayvdb)
70+
* [jorgeFons](https://github.com/jorgeFons)
71+
* [Kovner](https://github.com/Kovner)
72+
* [LarsBreddemann](https://github.com/LarsBreddemann)
73+
* [lboynton](https://github.com/lboynton)
74+
* [maddy-at-leisure](https://github.com/maddy-at-leisure)
75+
* [narcolino-tableau](https://github.com/narcolino-tableau)
76+
* [PatrickfBraz](https://github.com/PatrickfBraz)
77+
* [paulvic](https://github.com/paulvic)
78+
* [shrmnk](https://github.com/shrmnk)
79+
* [TableauKyle](https://github.com/TableauKyle)
80+
* [bossenti](https://github.com/bossenti)
81+
* [ma7tcsp](https://github.com/ma7tcsp)
82+
* [toomyem](https://github.com/toomyem)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To see sample code that works directly with the REST API (in Java, Python, or Po
1616
For more information on installing and using TSC, see the documentation:
1717
<https://tableau.github.io/server-client-python/docs/>
1818

19-
19+
To contribute, see our [Developer Guide](https://tableau.github.io/server-client-python/docs/dev-guide). A list of all our contributors to date is in [CONTRIBUTORS.md].
2020

2121
## License
2222
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftableau%2Fserver-client-python?ref=badge_large)

contributing.md

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Contribution can include, but are not limited to, any of the following:
1010
* Fix an Issue/Bug
1111
* Add/Fix documentation
1212

13-
Contributions must follow the guidelines outlined on the [Tableau Organization](http://tableau.github.io/) page, though filing an issue or requesting a feature do not require the CLA.
14-
1513
## Issues and Feature Requests
1614

1715
To submit an issue/bug report, or to request a feature, please submit a [GitHub issue](https://github.com/tableau/server-client-python/issues) to the repo.
@@ -22,65 +20,6 @@ files to assist in the repro. **Be sure to scrub the files of any potentially s
2220
For a feature request, please try to describe the scenario you are trying to accomplish that requires the feature. This will help us understand
2321
the limitations that you are running into, and provide us with a use case to know if we've satisfied your request.
2422

25-
### Label usage on Issues
26-
27-
The core team is responsible for assigning most labels to the issue. Labels
28-
are used for prioritizing the core team's work, and use the following
29-
definitions for labels.
30-
31-
The following labels are only to be set or changed by the core team:
32-
33-
* **bug** - A bug is an unintended behavior for existing functionality. It only relates to existing functionality and the behavior that is expected with that functionality. We do not use **bug** to indicate priority.
34-
* **enhancement** - An enhancement is a new piece of functionality and is related to the fact that new code will need to be written in order to close this issue. We do not use **enhancement** to indicate priority.
35-
* **CLARequired** - This label is used to indicate that the contribution will require that the CLA is signed before we can accept a PR. This label should not be used on Issues
36-
* **CLANotRequired** - This label is used to indicate that the contribution does not require a CLA to be signed. This is used for minor fixes and usually around doc fixes or correcting strings.
37-
* **help wanted** - This label on an issue indicates it's a good choice for external contributors to take on. It usually means it's an issue that can be tackled by first time contributors.
38-
39-
The following labels can be used by the issue creator or anyone in the
40-
community to help us prioritize enhancement and bug fixes that are
41-
causing pain from our users. The short of it is, purple tags are ones that
42-
anyone can add to an issue:
43-
44-
* **Critical** - This means that you won't be able to use the library until the issues have been resolved. If an issue is already labeled as critical, but you want to show your support for it, add a +1 comment to the issue. This helps us know what issues are really impacting our users.
45-
* **Nice To Have** - This means that the issue doesn't block your usage of the library, but would make your life easier. Like with critical, if the issue is already tagged with this, but you want to show your support, add a +1 comment to the issue.
46-
47-
## Fixes, Implementations, and Documentation
48-
49-
For all other things, please submit a PR that includes the fix, documentation, or new code that you are trying to contribute. More information on
50-
creating a PR can be found in the [Development Guide](https://tableau.github.io/server-client-python/docs/dev-guide).
51-
52-
If the feature is complex or has multiple solutions that could be equally appropriate approaches, it would be helpful to file an issue to discuss the
53-
design trade-offs of each solution before implementing, to allow us to collectively arrive at the best solution, which most likely exists in the middle
54-
somewhere.
55-
56-
## Getting Started
57-
58-
```shell
59-
python -m build
60-
pytest
61-
```
62-
63-
### To use your locally built version
64-
```shell
65-
pip install .
66-
```
67-
68-
### Debugging Tools
69-
See what your outgoing requests look like: https://requestbin.net/ (unaffiliated link not under our control)
70-
71-
72-
### Before Committing
73-
74-
Our CI runs include a Python lint run, so you should run this locally and fix complaints before committing as this will fail your checkin.
75-
76-
```shell
77-
# this will run the formatter without making changes
78-
black . --check
79-
80-
# this will format the directory and code for you
81-
black .
23+
### Making Contributions
8224

83-
# this will run type checking
84-
pip install mypy
85-
mypy tableauserverclient test samples
86-
```
25+
Refer to the [Developer Guide](https://tableau.github.io/server-client-python/docs/dev-guide) which explains how to make contributions to the TSC project.

getcontributors.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import json
2+
import requests
3+
4+
5+
logins = json.loads(
6+
requests.get("https://api.github.com/repos/tableau/server-client-python/contributors?per_page=200").text
7+
)
8+
for login in logins:
9+
print(f"* [{login["login"]}]({login["html_url"]})")

tableauserverclient/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
FlowRunItem,
1818
FileuploadItem,
1919
GroupItem,
20+
GroupSetItem,
2021
HourlyInterval,
2122
IntervalItem,
2223
JobItem,
@@ -82,6 +83,7 @@
8283
"FlowRunItem",
8384
"FileuploadItem",
8485
"GroupItem",
86+
"GroupSetItem",
8587
"HourlyInterval",
8688
"IntervalItem",
8789
"JobItem",

tableauserverclient/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from tableauserverclient.models.flow_item import FlowItem
1515
from tableauserverclient.models.flow_run_item import FlowRunItem
1616
from tableauserverclient.models.group_item import GroupItem
17+
from tableauserverclient.models.groupset_item import GroupSetItem
1718
from tableauserverclient.models.interval_item import (
1819
IntervalItem,
1920
DailyInterval,
@@ -65,6 +66,7 @@
6566
"FlowItem",
6667
"FlowRunItem",
6768
"GroupItem",
69+
"GroupSetItem",
6870
"IntervalItem",
6971
"JobItem",
7072
"DailyInterval",

tableauserverclient/models/database_item.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def __init__(self, name, description=None, content_permissions=None):
4444

4545
self._tables = None # Not implemented yet
4646

47+
def __str__(self):
48+
return "<Database {0} '{1}'>".format(self._id, self.name)
49+
50+
def __repr__(self):
51+
return self.__str__() + " { " + ", ".join(" % s: % s" % item for item in vars(self).items()) + "}"
52+
4753
@property
4854
def dqws(self):
4955
if self._data_quality_warnings is None:

tableauserverclient/models/flow_item.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from defusedxml.ElementTree import fromstring
77

88
from tableauserverclient.datetime_helpers import parse_datetime
9-
from .connection_item import ConnectionItem
10-
from .dqw_item import DQWItem
11-
from .exceptions import UnpopulatedPropertyError
12-
from .permissions_item import Permission
13-
from .property_decorators import property_not_nullable
14-
from .tag_item import TagItem
9+
from tableauserverclient.models.connection_item import ConnectionItem
10+
from tableauserverclient.models.dqw_item import DQWItem
11+
from tableauserverclient.models.exceptions import UnpopulatedPropertyError
12+
from tableauserverclient.models.permissions_item import Permission
13+
from tableauserverclient.models.property_decorators import property_not_nullable
14+
from tableauserverclient.models.tag_item import TagItem
1515

1616

1717
class FlowItem(object):
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from typing import Dict, List, Optional
2+
import xml.etree.ElementTree as ET
3+
4+
from defusedxml.ElementTree import fromstring
5+
6+
from tableauserverclient.models.group_item import GroupItem
7+
8+
9+
class GroupSetItem:
10+
tag_name: str = "groupSet"
11+
12+
def __init__(self, name: Optional[str] = None) -> None:
13+
self.name = name
14+
self.id: Optional[str] = None
15+
self.groups: List["GroupItem"] = []
16+
self.group_count: int = 0
17+
18+
def __str__(self) -> str:
19+
name = self.name
20+
id = self.id
21+
return f"<{self.__class__.__qualname__}({name=}, {id=})>"
22+
23+
def __repr__(self) -> str:
24+
return self.__str__()
25+
26+
@classmethod
27+
def from_response(cls, response: bytes, ns: Dict[str, str]) -> List["GroupSetItem"]:
28 B41A +
parsed_response = fromstring(response)
29+
all_groupset_xml = parsed_response.findall(".//t:groupSet", namespaces=ns)
30+
return [cls.from_xml(xml, ns) for xml in all_groupset_xml]
31+
32+
@classmethod
33+
def from_xml(cls, groupset_xml: ET.Element, ns: Dict[str, str]) -> "GroupSetItem":
34+
def get_group(group_xml: ET.Element) -> GroupItem:
35+
group_item = GroupItem()
36+
group_item._id = group_xml.get("id")
37+
group_item.name = group_xml.get("name")
38+
return group_item
39+
40+
group_set_item = cls()
41+
group_set_item.name = groupset_xml.get("name")
42+
group_set_item.id = groupset_xml.get("id")
43+
group_set_item.group_count = int(count) if (count := groupset_xml.get("groupCount")) else 0
44+
group_set_item.groups = [
45+
get_group(group_xml) for group_xml in groupset_xml.findall(".//t:group", namespaces=ns)
46+
]
47+
48+
return group_set_item

tableauserverclient/models/job_item.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def __init__(
3333
datasource_id: Optional[str] = None,
3434
flow_run: Optional[FlowRunItem] = None,
3535
updated_at: Optional[datetime.datetime] = None,
36+
workbook_name: Optional[str] = None,
37+
datasource_nam F438 e: Optional[str] = None,
3638
):
3739
self._id = id_
3840
self._type = job_type
@@ -47,6 +49,8 @@ def __init__(
4749
self._datasource_id = datasource_id
4850
self._flow_run = flow_run
4951
self._updated_at = updated_at
52+
self._workbook_name = workbook_name
53+
self._datasource_name = datasource_name
5054

5155
@property
5256
def id(self) -> str:
@@ -117,6 +121,14 @@ def flow_run(self, value):
117121
def updated_at(self) -> Optional[datetime.datetime]:
118122
return self._updated_at
119123

124+
@property
125+
def workbook_name(self) -> Optional[str]:
126+
return self._workbook_name
127+
128+
@property
129+
def datasource_name(self) -> Optional[str]:
130+
return self._datasource_name
131+
120132
def __str__(self):
121133
return (
122134
"<Job#{_id} {_type} created_at({_created_at}) started_at({_started_at}) updated_at({_updated_at}) completed_at({_completed_at})"
@@ -148,8 +160,10 @@ def _parse_element(cls, element, ns):
148160
mode = element.get("mode", None)
149161
workbook = element.find(".//t:workbook[@id]", namespaces=ns)
150162
workbook_id = workbook.get("id") if workbook is not None else None
163+
workbook_name = workbook.get("name") if workbook is not None else None
151164
datasource = element.find(".//t:datasource[@id]", namespaces=ns)
152165
datasource_id = datasource.get("id") if datasource is not None else None
166+
datasource_name = datasource.get("name") if datasource is not None else None
153167
flow_run = None
154168
updated_at = parse_datetime(element.get("updatedAt", None))
155169
for flow_job in element.findall(".//t:runFlowJobType", namespaces=ns):
@@ -172,6 +186,8 @@ def _parse_element(cls, element, ns):
172186
datasource_id,
173187
flow_run,
174188
updated_at,
189+
workbook_name,
190+
datasource_name,
175191
)
176192

177193

0 commit comments

Comments
 (0)
0