noeun-kim opened a new issue, #36142:
URL: https://github.com/apache/airflow/issues/36142
### Description
### **Summary**
I'm looking to work on sensing multiple partition IDs and I'm attempting to
modify the relevant class for this purpose.
I believe it's a simple adjustment—changing `partition_id` from a string
type to a list type in `BigQueryTablePartitionExistenceSensor`, `BigQueryHook`
But I'm unsure about the modifications needed in
`BigQueryTablePartitionExistenceTrigger`
Could you provide some ideas on how to make this adjustment?
### Use case/motivation
I expect to be used as follows
```
from airflow.providers.google.cloud.sensors.bigquery import
BigQueryTablePartitionsExistenceSensor
test_sensor = BigQueryTablePartitionsExistenceSensor(
task_id=f"test_sensor",
project_id={project_id},
dataset_id={dataset_id},
table_id={table_id},
partition_ids=[{id}, {id}, ...],
poke_interval={poke_interval},
timeout={timeout},
deferrable={deferrable},
)
```
```
class BigQueryHook(GoogleBaseHook, DbApiHook):
...
@GoogleBaseHook.fallback_to_default_project_id
def table_partitions_exists(
self, dataset_id: str, table_id: str, partition_ids: list[str],
project_id: str
) -> bool:
"""Check if date-type partition ids are sequential in GBQ Table
:param project_id: GCP project id
:param dataset_id: The name of the dataset.
:param table_id: The name of the table to check the existence of.
:param partition_ids: List of partition ids
"""
table_reference = TableReference(DatasetReference(project_id,
dataset_id), table_id)
try:
sequential_check = set(partition_ids).issubset(set(
self.get_client(project_id=project_id).list_partitions(table_reference))
)
return sequential_check
except NotFound:
return False
```
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]