beam-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-12024) Add well-documented DataFrame example pipelines
Date Wed, 07 Apr 2021 18:28:00 GMT

     [ https://issues.apache.org/jira/browse/BEAM-12024?focusedWorklogId=578531&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-578531
]

ASF GitHub Bot logged work on BEAM-12024:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/21 18:27
            Start Date: 07/Apr/21 18:27
    Worklog Time Spent: 10m 
      Work Description: rohdesamuel commented on a change in pull request #14308:
URL: https://github.com/apache/beam/pull/14308#discussion_r608892895



##########
File path: sdks/python/apache_beam/examples/dataframe/taxiride.py
##########
@@ -0,0 +1,115 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""Pipelines that use the DataFrame API to process NYC taxiride CSV data."""
+
+# pytype: skip-file
+
+from __future__ import absolute_import
+
+import argparse
+import logging
+
+import apache_beam as beam
+from apache_beam.dataframe.convert import to_dataframe
+from apache_beam.dataframe.convert import to_pcollection
+from apache_beam.dataframe.io import read_csv
+from apache_beam.io import ReadFromText
+from apache_beam.options.pipeline_options import PipelineOptions
+
+ZONE_LOOKUP_PATH = "gs://apache-beam-samples/nyc_taxi/misc/taxi+_zone_lookup.csv"
+
+
+def run_aggregation_pipeline(pipeline_args, input_path, output_path):
+  # The pipeline will be run on exiting the with block.
+  with beam.Pipeline(options=PipelineOptions(pipeline_args)) as p:
+    rides = p | read_csv(input_path)

Review comment:
       For my own edification, does read_csv expand and return a beam DataFrame?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 578531)
    Time Spent: 2h 10m  (was: 2h)

> Add well-documented DataFrame example pipelines
> -----------------------------------------------
>
>                 Key: BEAM-12024
>                 URL: https://issues.apache.org/jira/browse/BEAM-12024
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: P2
>              Labels: dataframe-api
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




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

Mime
View raw message