Skip to content

Commit

Permalink
fateflow: optimize table bind
Browse files Browse the repository at this point in the history
Signed-off-by: zhihuiwan <[email protected]>
  • Loading branch information
zhihuiwan committed Jan 17, 2023
1 parent 996eab5 commit f501efb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/fate_flow/apps/table_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from fate_flow.manager.data_manager import DataTableTracker, TableStorage, SchemaMetaParam, AnonymousGenerator
from fate_flow.operation.job_saver import JobSaver
from fate_flow.operation.job_tracker import Tracker
from fate_flow.utils.data_utils import get_extend_id_name
from fate_flow.utils.data_utils import get_extend_id_name, address_filter
from fate_flow.worker.task_executor import TaskExecutor
from fate_flow.utils.api_utils import get_json_result, error_response, validate_request
from fate_flow.utils import job_utils, schedule_utils
Expand Down Expand Up @@ -242,7 +242,7 @@ def table_api(table_func):
table_schema = table_meta.get_schema()
extend_sid = table_meta.get_extend_sid()
table_schema.update()
address = table_meta.get_address().__dict__
address = address_filter(table_meta.get_address())
enable = not table_meta.get_disable()
origin = table_meta.get_origin()
exist = 1
Expand Down
9 changes: 9 additions & 0 deletions python/fate_flow/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
#
from fate_arch.abc import StorageTableMetaABC, AddressABC
from fate_arch.common.address import MysqlAddress, HiveAddress
from fate_arch.common.data_utils import default_output_fs_path
from fate_arch.computing import ComputingEngine
from fate_arch.storage import StorageEngine, StorageTableMeta
Expand Down Expand Up @@ -155,3 +156,11 @@ def get_input_search_type(parameters):
return InputSearchType.JOB_COMPONENT_OUTPUT
else:
return InputSearchType.UNKNOWN


def address_filter(address):
if isinstance(address, MysqlAddress):
address.passwd = None
if isinstance(address, HiveAddress):
address.password = None
return address.__dict__

0 comments on commit f501efb

Please sign in to comment.