apache / apache/wayang

not necesary it it 0

Open
#156 0 comments 0 reactions 0 assignees View on GitHub
todo
Dominant language
Java
Stars
274
Forks
140
Avg merge
5d 16h
Merged PRs (30d)
4

Description

not necesary it it 0

https://github.com/apache/incubator-wayang/blob/4cc0bfdca06dda171b661822daae5fa438d9d475/python/src/pywy/core/translator.py#L49

```python

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

from pywy.graph.types import (WGraphOfVec, NodeVec)
from pywy.core.plugin import Plugin
from pywy.core.plan import PywyPlan
from pywy.core.mapping import Mapping

class Translator:

plugin: Plugin
plan: PywyPlan

def __init__(self, plugin: Plugin, plan: PywyPlan):
self.plugin = plugin
self.plan = plan

def translate(self):
mappings: Mapping = self.plugin.get_mappings()
graph = WGraphOfVec(self.plan.sinks)

def translate2plugin(current_op: NodeVec, next_op: NodeVec):
if current_op is None:
return

if current_op.current[1] is None:
current_op.current[1] = mappings.get_instanceof(current_op.current[0])

if next_op is None:
return
if next_op.current[1] is None:
next_op.current[1] = mappings.get_instanceof(next_op.current[0])

# TODO not necesary it it 0
current_op.current[1].connect(0, next_op.current[1], 0)

graph.traversal(graph.starting_nodes, translate2plugin)

node = []
for elem in graph.starting_nodes:
node.append(elem.current[1])

return PywyPlan({self.plugin}, node)

```

faa6d95fe21aa8beb6316ff96ecbcc5626efb21e

Contributor guide

Open the contributing guide

Research direction

Start in python/src/pywy/core/translator.py at the TODO near line 49, then read the surrounding graph traversal and Plugin connection APIs. Determine what the comment means by "0" and verify the intended translation behavior before changing it; done means the zero-index connection behavior matches the project’s expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.