|
14 | 14 |
|
15 | 15 | """Base classes and helpers for job classes.""" |
16 | 16 |
|
17 | | -from __future__ import annotations |
18 | | - |
19 | 17 | from collections import namedtuple |
20 | 18 | import copy |
21 | 19 | import http |
@@ -442,12 +440,9 @@ def configuration(self) -> _JobConfig: |
442 | 440 | return configuration |
443 | 441 |
|
444 | 442 | @property |
445 | | - def job_id(self) -> Optional[str]: |
| 443 | + def job_id(self): |
446 | 444 | """str: ID of the job.""" |
447 | | - return typing.cast( |
448 | | - Optional[str], |
449 | | - _helpers._get_sub_prop(self._properties, ["jobReference", "jobId"]), |
450 | | - ) |
| 445 | + return _helpers._get_sub_prop(self._properties, ["jobReference", "jobId"]) |
451 | 446 |
|
452 | 447 | @property |
453 | 448 | def parent_job_id(self): |
@@ -498,24 +493,18 @@ def num_child_jobs(self): |
498 | 493 | return int(count) if count is not None else 0 |
499 | 494 |
|
500 | 495 | @property |
501 | | - def project(self) -> Optional[str]: |
| 496 | + def project(self): |
502 | 497 | """Project bound to the job. |
503 | 498 |
|
504 | 499 | Returns: |
505 | 500 | str: the project (derived from the client). |
506 | 501 | """ |
507 | | - return typing.cast( |
508 | | - Optional[str], |
509 | | - _helpers._get_sub_prop(self._properties, ["jobReference", "projectId"]), |
510 | | - ) |
| 502 | + return _helpers._get_sub_prop(self._properties, ["jobReference", "projectId"]) |
511 | 503 |
|
512 | 504 | @property |
513 | | - def location(self) -> Optional[str]: |
| 505 | + def location(self): |
514 | 506 | """str: Location where the job runs.""" |
515 | | - return typing.cast( |
516 | | - Optional[str], |
517 | | - _helpers._get_sub_prop(self._properties, ["jobReference", "location"]), |
518 | | - ) |
| 507 | + return _helpers._get_sub_prop(self._properties, ["jobReference", "location"]) |
519 | 508 |
|
520 | 509 | @property |
521 | 510 | def reservation_id(self): |
|
0 commit comments