You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2021/03/14 17:19:00 UTC

[jira] [Commented] (BEAM-11620) PeriodicImpulse uses unspecified / operator on Durations

    [ https://issues.apache.org/jira/browse/BEAM-11620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301225#comment-17301225 ] 

Beam JIRA Bot commented on BEAM-11620:
--------------------------------------

This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.

Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.


> PeriodicImpulse uses unspecified / operator on Durations
> --------------------------------------------------------
>
>                 Key: BEAM-11620
>                 URL: https://issues.apache.org/jira/browse/BEAM-11620
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>    Affects Versions: 2.26.0, 2.27.0
>            Reporter: Mátyás Manninger
>            Priority: P2
>              Labels: stale-P2
>
> In the periodicsequence.py on line 42 there is a division which throws the following error:
> {code:python}
> File "/home/user/.virtualenvs/dflowenv/lib/python3.8/site-packages/apache_beam/transforms/periodicsequence.py", line 42, in initial_restriction
>     total_outputs = math.ceil((end - start) / interval)
> TypeError: unsupported operand type(s) for /: 'Duration' and 'Duration' [while running 'read/periodic_impulse/GenSequence/PairWithRestriction']
> {code}
> Here is the code segment that generated this error:
> {code:python}
> class BigQuerySideinputPI(beam.PTransform):    def __init__(self, query, refresh_interval = 86400):
>         super(BigQuerySideinputPI, self).__init__()
>         self.query = query
>         self.refresh_interval = refresh_interval    def expand(self, pcoll):
>         return (
>             pcoll
>             | 'periodic_impulse' >> PeriodicImpulse(fire_interval=self.refresh_interval, apply_windowing=True)
>             | 'inject_query' >> beam.Map(lambda x: self.query)
>             | 'run_query' >> beam.ParDo(BigQueryRead())){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)