

# Reading from Asana entities


 **Prerequisites** 

An Asana Object you would like to read from. Refer the supported entities table below to check the available entities. 

 **Supported entities for source** 


| Entity | Can be Filtered | Supports Limit | Supports Order By | Supports Select \$1 | Supports Partitioning | 
| --- | --- | --- | --- | --- | --- | 
|  Workspace  | No | Yes | No | Yes | No | 
| Tag | No | Yes | No | Yes | No | 
| User | No | Yes | No | Yes | No | 
|  Portfolio  | No | Yes | No | Yes | No | 
| Team | No | Yes | No | Yes | No | 
| Project | Yes | Yes | No | Yes | No | 
| Section | No | Yes | No | Yes | No | 
| Task  | Yes | No | No | Yes | Yes | 
| Goal | Yes | Yes | No | Yes | No | 
|  AuditLogEvent  | Yes | Yes | No | Yes | No | 
|  Status Update  | Yes | Yes | No | Yes | No | 
|  Custom Field  | No | Yes | No | Yes | No | 
|  Project Brief  | Yes | No | No | Yes | Yes | 

 **Example** 

```
read_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Asana",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "task/workspace:xxxx",
        "API_VERSION": "1.0",
        "PARTITION_FIELD": "created_at",
        "LOWER_BOUND": "2024-02-05T14:09:30.115Z",
        "UPPER_BOUND": "2024-06-07T13:30:00.134Z",
        "NUM_PARTITIONS": "3"
    }
```

 **Asana entity and field details** 
+ [Workspace](https://developers.asana.com/docs/workspaces)
+ [Tag](https://developers.asana.com/docs/tags)
+ [User](https://developers.asana.com/docs/users)
+ [Portfolio](https://developers.asana.com/docs/portfolios)
+ [Team](https://developers.asana.com/docs/teams)
+ [Project](https://developers.asana.com/docs/get-all-projects-in-a-workspace)
+ [Section](https://developers.asana.com/docs/get-sections-in-a-project)
+ [Task](https://developers.asana.com/docs/search-tasks-in-a-workspace) 
+ [Goal](https://developers.asana.com/docs/get-goals)
+ [AuditLogEvent](https://developers.asana.com/docs/audit-log-api)
+ [Status Update](https://developers.asana.com/reference/status-updates)
+ [Custom Field](https://developers.asana.com/reference/custom-fields)
+ [Project Brief](https://developers.asana.com/reference/project-briefs)

 **Partitioning queries** 

Additional spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS` can be provided if you want to utilize concurrency in Spark. With these parameters, the original query would be split into `NUM_PARTITIONS` number of sub-queries that can be executed by spark tasks concurrently. 
+ `PARTITION_FIELD`: the name of the field to be used to partition query. 
+ `LOWER_BOUND`: an inclusive lower bound value of the chosen partition field. 

  For date, we accept the Spark date format used in Spark SQL queries. Example of valid values: `2024-06-07T13:30:00.134Z`. 
+ `UPPER_BOUND`: an exclusive upper bound value of the chosen partition field. 
+ `NUM_PARTITIONS`: number of partitions. 

 Entity-wise partitioning field support details are captured in the following table. 


| Entity Name | Partitioning Field | Data Type | 
| --- | --- | --- | 
| Task |  created\$1at  | DateTime | 
| Task |  modified\$1at  | DateTime | 

 **Example** 

```
read_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Asana",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "task/workspace:xxxx",
        "API_VERSION": "1.0",
        "PARTITION_FIELD": "created_at",
        "LOWER_BOUND": "2024-02-05T14:09:30.115Z",
        "UPPER_BOUND": "2024-06-07T13:30:00.134Z",
        "NUM_PARTITIONS": "3"
    }
```